Re: Reading a file with 4GL
Posted in 1997
What I tend to do is:
create temp table t1 ( i serial, txt char(100) ) with no log ;
run "sed 's/$/|/' datafile > datafile_plus"
load from "datafile_plus" insert into t1 ( txt ) ;
(where 'datafile' is the you want to read in)
Then you can select the data out of temp table t1. The serial "i" will
keep the lines in sequence.
Note that the example assumes that:
(a) The lines in the input file are of bounded length (100 in this case);
(b) There is some character guaranteed NOT to appear in the input file
("|" in this case, but the delimiter can be anything).
This works well for me.
- Paul (not a spokesman)
In article <33E8CFCB.64AA@bst.bls.com>,
BellSouth <Michael.E.Buchanan@bst.bls.com> wrote:
>Does anyone know how to read data from a text file into a 4GL program?
>I want to read data from a configuration file and initialize some
>program variables.
>
>Thanks in advance,
>Mike