Page 1 of 1
combining multiple lines to single line
Posted: Sun Oct 19, 2008 6:46 am
by phani
I had below sample data
'1000329',xx,Coi,03-JAN-62 12.00. AM,ORANG
E,2800
i want the data to be in single line
'1000329',xx,Coi,03-JAN-62 12.00. AM,ORANGE,2800
Posted: Sun Oct 19, 2008 8:52 am
by ben_josephs
Under exactly what circumstances do you want lines joined?
Posted: Sun Oct 19, 2008 9:34 am
by phani
The above sample data is the one of the record in the resultset obtained from database After formatting the data in textpad i need to save the file as .csv format .Some of the records obtained from resultset are aligned in same line but some records are like above.There are total of 20,000 records like this Editing them manually is taking one day completely
Pls help on this.
Posted: Sun Oct 19, 2008 10:13 am
by ben_josephs
That is not an answer to the question. Only you know what your records look like.
How do we distinguish between complete lines and split ones? Can we tell by the number of commas? Can quoted fields contain commas?
If the incomplete lines are those that contain fewer than 5 commas and if the fields do not contain commas, then this might do what you want. It finds each line containing fewer than 5 commas and removes the newline at the end:
Find what: ^(([^,]*,){0,4}[^,]*)\n
Replace with: \1
[X] Regular expression
Replace All
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax