[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] Line Terminators on flat files
Convert the flat file to a .csv file with "s around long text. Do this by
importing to excel and saving as .csv
Then, using an #include like Ray's csv.sqh, read the file and get the fields
into your variables like this:
begin-program
open 'your_file.csv' as 1 for-reading
record=5000:vary
while 1
read 1 into $line:5000
if #end-file
break
end-if
do csv_get_field( $line, $variable_1 )
do csv_get_field( $line, $variable_2 )
do csv_get_field( $line, $variable_n )
do your_procedure
end-while
close 1
end-program
Dave
-----Original Message-----
From: sqr-users-admin@sqrug.org [mailto:sqr-users-admin@sqrug.org]On
Behalf Of Peter_Wheeler@gov.nt.ca
Sent: Thursday, February 20, 2003 12:38 PM
To: sqr-users@sqrug.org
Subject: [sqr-users] Line Terminators on flat files
Hello,
I am trying to read in a flat file through SQR that has 4 fields, with
the last field being a long datatype. This field is anywhere from 100 to
4000 characters in lentgh. It consists of written paragraphs, including
most ascii characters, as well as numerous carraige returns. My field
separator is a 'pipe' - |.
I cannot get SQR to properly read these 'long' lines of data as it
believes the CR is the line terminator. Is there a way for us to set the
line terminator to whatever character we want in the SQR?
Thanks
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users