> Thanks a lot guys, I solved the problem - replaced the #10's with
#13's
Hi Theo,
You can load the file into MS Word - then use SaveAs (*.txt - plain
text) and Word will replace the unix line terminator with CRLF for
you - quick & dirty so I like it
--
Paul Motyer
HELP! - how to I get over this one please?
Is there a way i can "convert" it to be a normal comma delimited file?
I would normally read a comma/delimited file ok with this code
while not eof(f) do
begin
readln(f, s);
import.append;
x:=0;
while pos (',',s) <> 0 do
begin
import.fields[x].asstring:=copy (s,1,pos(',',s)-1);
s:= copy (s, pos(',',s)+1,length(s)-pos(',',s));
x:=x+1;
end;
import.fields[x].asstring:=s;
end;
import.post;
CloseFile(f);
Your help will be highly appreciated, thank you
Theo
Unix uses a different line terminator than Windows. Where Windows
uses CRLF for a line terminator, Unix uses CR. Or it might be LF. I
forget which but it definitely uses only one of them.
Maybe there's a utility you could use to preprocess the file and turn
CR into CRLF. Or you could change your code that reads the file by
reading byte by byte until you encounter the line terminator.
>Hi (my apologies but I'm deperate for a quick answer, and all the Gurus hang
>around here)
>I have a problem with a text file from a unix machine.
>Normally I have no problems reading the text. This file however
>has only one line broken with little blocks, (control characters)
>visible if file opened with Notepad. It's almost as if it is rtf, opens ok
>with wordpad.
>
>HELP! - how to I get over this one please?
Unix convention is to only have a LF as line separator, whereas
DOS and thus Windows uses a CR + LF pair. The old readln needs
this cr lf pair.
There is a pair of utilities unix2dos and dos2unix which switches
between these conventions. So you should get yourself a copy
of cygwin, the most common windows implementation of the GNU
environment.
In the latest Delphi version there is a utility SetLineBReakStyle which allows
to adjust the convention used in a textfile.
Regards from Germany
Franz-Leo
Franz-Leo Chomse(mailto:Franz-Le...@tpx.turbopower.com)
FF Foundry at http://community.turbopower.com
Newsgroup search at http://www.tamaracka.com
Fixes and updates at ftp://ftp.turbopower.com/pub/flash/updates/
#13 alone is invalid, it can't be read with readln anymore after the LineBreak extension.
Open it with the console 'Edit' program, and save it. The line terminators
will now all be correct for Windows or DOS. The 'Edit' program can be found
in the [WINDIR]/Command directory.
Curt.
"Theo Pistorius" <th...@powertill.com> wrote in message
news:k4FAYyK...@tpsmail01.turbopower.net...