Post by charlesIt looks like it shows up fine here, but when I use the notepad, it's all
in one line. I can't import the text file into the table, as it truncates
to record number one. (the strange thing is, under windows command
prompt's edit, the text shows up fine.). Obviously I'm having some
problem with control characters. How do I get around this problem.
Maybe there is some user-built dBase utility that would allow you to read
your file directly into a table. But here's some advice based on the
assumption you will modify and read your text file with low-level functions
before appending the data into a table.
First, you apparently have some type of line terminator, but not the newline
pair : chr(13)+chr(10). So you need to find out what that line terminator
is. You can use the file object.
f = new file(); f.open(<your file>); mstr = f.read(1000)
start checking for one of the common line terminators
?at(chr(13)+chr(10), mstr)
?at(chr(13), mstr)
?at(chr(10), mstr)
Look in help class file, topic gets() for other common line terminators.
So lets say you discover that the line terminators are chr(10).
You can create another file into which you will write the output file.
g = new file()
g.create(<output file>,'RW')
Now you read the file line by line, writing the result into your new file.
puts() will add on chr(13)+chr(10) by default.
f.seek(0)
do while not f.eof()
mstr = f.gets(1000, chr(10))
g.puts(mstr)
enddo
etc.
This should give you a file you can read via modi file, etc.
If that file has a regular spacing of data values, you might be able to
append it into a table as SDF. (You would have to construct a table having
the same width as in the text file for each field.) If the values are
separated by tabs, chr(9), then you might need to read the file again to
convert the tabs to commas. Then you could append it as a delimited text
file. That's a little info on basic methods.
But I think there is a utility in the dUFLP that imports tab-separated text
files. Mabe it also reads text files with non-standard line terminators.
E.L.