Re: HOW in the HECK can we import comma quote delimted ASCII !!!????
Posted in 1995
Topics: Server Administration
In article <3n8d4e$6qr@vixen.cso.uiuc.edu> johnb@ux1.cso.uiuc.edu (John Blomberg) 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. We looked at dbload and got it to work ONLY
>>after converting our comma quote delimited ascii text file to single
>>character limited ascii text with much labor. comma quote delimited
>>ascii is very much a standard data format. There MUST be a way to import
>>comma quote delimited text into informix, but I sure could not find it !
>>See we are trying to import dbaseIII and paradox files into informix by
>>first converting them to the WORLD STANDARD of comma quote delimited ascii
>>text, but informix's dbload seems to only allow importation of ascii text
>>that is delimited with a SINGLE character. Please tell us this is NOT so.
>
>
>> Thanks in advance,
Very simple to convert your double quote delimited, comma separated file to
a single character delimited file with SED (standard Unix stream editor, also
avaiable in MKS Toolkit for DOS, OS/2, NT platforms)
create file 'convert.sed', only three simply lines
s/","/|/g; - this one changes all "," to |
s/^"//; - this one removes " at beginning of each line
s/"$//; - this one removes " at end of each line
Then run sed like this: sed -f convert.sed input_file > output_file
Your output file will be ready to import with either dbload or an SQL load statement.
--
John Postma
Standard disclaimer - comments are my own, not my employers, etc... etc...