Scripting question, new problem

Patton Echols p.echols at comcast.net
Sat Dec 11 02:44:29 UTC 2010


I'm still working on my script to import data into gmail from a 
proprietary database.  Most is working ok.  The work flow is to export 
from the database to a csv flat file, then run the script to extract the 
data and reformat to a new CSV that gmail can swallow.  (An absurd 
amount of googling spent on that!)

Current problem is the export a subset of the database records have, for 
"street address" a two line entry like this:

123 main street
Apartment A

When that is exported, it adds a carriage return to the CSV file.

What I'd like to do is have the script walk through the file, and if 
there is a line without 13 fields, combine it with the next line. 

Since all the date is strings, and quoted, the alternative would be to 
find a line that does not start with a literal  " and  "backspace" once. 

Can anyone suggest where to start?

(By the way, yes I could manually fix the file.  But the intention is to 
make this a process that can be repeated weekly, sort of like a one way 
sync.)

Thanks

--PE




More information about the ubuntu-users mailing list