Re: HOW in the HECK can we import comma quote delimted ASCII !!!????
Posted in 1995
Quoting Michael Wiik... } } root@TeamInfinity.com (root) writes: } } } >I cannot find out how to import comma quote delimited text into Informix } >if my life depended on it. [...] } > Thanks in advance, } > root@TeamInfinity.com (Eric Sean Webber) } } } A couple of one-liner filters (presuming you have UNIX): } } : } # qa2sql } # convert QA files to SQL load file } } sed 's/\\",\\"/|/g' | tr -d "\\"" | sed 's/$/|/' } } : } # sql2qa } # convert SQL unload output to QA input. } } sed -e 's/|$/\\"/' -e 's/^/\\"/' -e 's/|/\\",\\"/g' } Although I don't have a solution (yet), this probably isn't going to work. If I remember correctly, in a comma-quote delimited file, the commas are the delimiters and only the string fields are surrounded by quotes (numerics aren't). I assume this is in case there are commas imbedded in the string fields. If I had this delema, I'd write a filter in PERL (or C). DAS -- Dave Snyder @ Bell Atlantic - Philadelphia, PA WEB: http://www.ece.vill.edu/~dave/index.html EMAIL: (w) ddx85qr@boots.bell-atl.com (h) dave@das13.snide.com