Re: HOW in the HECK can we import comma quote delimted ASCII !!!????
Posted in 1995
In <mwiikD78M83.DwL@netcom.com> mwiik@netcom.com (Michael Wiik) writes: >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/$/|/' Well, no. It's not as simple as changing ...","... into ...|... since you may well find you have data like: 123,"foo",456 Nor can you just replace all commas, since you may well have: 123,"foo, bar",456 with a quoted comma. A short C or perl program could do it by tracking when it's inside quotes and not. But Jonathan Leffler says the sqlcmd in the archives does it, so, why bother. But just to address his point about standards, I don't believe it's a "standard" in the ISO sense, but, it is effectively one, since most every spreadsheet in the world uses it. I thus agree with the sentiment that Informix's products should include utilities to import/export that format. What would also be really helpful is one to import/export mainframe formats. I've spent far too much time recently diddling with EBCDIC, COBOL COMP3 data, packed decimal data, etc. Blech! But hey, really, Informix marketers -- this could be a selling point -- "here's an easy way to convert your AS/400 database into Informix" or "share your Informix data with your mainframe using our new informix2ibm..." I'm sure my client would even *PAY* for such general utilities. --Or-- Did I miss something and these are in the archive??? -- Andrew Burt aburt@du.edu "'Ere, he says he's not dead."