How to export info into one row of a csv?

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
If u get a block of text like this:


(07) 5371 9820
Australia
Sanja

And export it into .csv or .db in zp, every space bar becomes a new column and every new line becomes a new row. OpenOffice has an option to ignore space bars as separators, so it can all be put in the same column. But am I right if I understand that every new line can only be converted into a new column if we do a regex replace beforehand where every line break becomes a comma or, when creating the file we make sure commas are between the values and not line breaks? But then the problem arises of how to deal with values that actually consist of commas, as they will mess up the order of the table.

There must be some kind of way to get a csv file to create a new column within the same row when it encounters a line break. A space or a comma would bring countless issues, but a line break would be perfect. Can this be done?
 

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
Well, I've seen understood this was a fairly basic issue that merely required putting " around every value you want in each column and making sure the commas are outside the ". But now, I'm wondering how I can turn line breaks into ", basically because I have many steps geared towards making simple appending of strings onto files and it would be a lot better if I learnt how to just switch the line breaks into ". Also, even if I did gear all my steps towards apostrophes, I'd have to apply long-winded regex patterns when trying to extract them, so again I'm better off changing them around at the end or beginning of the templates.

So how would you turn
Li Hua

Ting
Via del Pontiere, 135
Villar Perosa
into

"Li Hua","Ting","Via del Pontiere, 135","Villar Perosa"

The thing is I wouldn't know how to do this as the macros builder only has RegExp.Replace, which is about replacing a string, but doesn't seem to be about replacing certain features of a block.

Can you think of an easier way out, or do you know how to turn line breaks into apostrophes? thanks

Nvm, I'll just extract them to a file bit by bit on macros surrounded by apostrophes. Can't believe I didn't think of that before.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)