Append from myfile.txt SDF
Posted: Fri Mar 08, 2013 4:09 am
There is one place I have found in the DOS/Windows environment where Clipper and Harbour are not the same...
I know the reason why, but would like to know how to work around it.
Here is the issue ... The simple command: Append from myfile.txt SDF will work in Clipper for most all types of text files...
Example,, You can have a regular DOS/Windows style text file where each line ends with (CR,LF),, or you can have a *nix style file where each line ends only with (LF)..
Your Clipper compiled program will load either one into your favorite DBF file with the simple command mentioned above... No problem...
Harbour in the DOS/Windows environment will not do this on the *nix style text files that have the "LF" only string ends.... It quits,, generally reading a partial one record and stops.
Harbour will work fine with the "CRLF" string ending text files ,, but not "LF" only ...
I can take any of these problem files and open them in notepad and "save as" a new file,, and Harbour works fine because the saved file has "CRLF" at the end of each line instead of "LF" .......
I would like to know the proper instruction in Harbour to read these *nix style text files.
A long time ago I read about this on the net, but at the time I wasn't dealing with the issue.. Today, I can't find the information I read at that time.
Thank You,
Bill
I know the reason why, but would like to know how to work around it.
Here is the issue ... The simple command: Append from myfile.txt SDF will work in Clipper for most all types of text files...
Example,, You can have a regular DOS/Windows style text file where each line ends with (CR,LF),, or you can have a *nix style file where each line ends only with (LF)..
Your Clipper compiled program will load either one into your favorite DBF file with the simple command mentioned above... No problem...
Harbour in the DOS/Windows environment will not do this on the *nix style text files that have the "LF" only string ends.... It quits,, generally reading a partial one record and stops.
Harbour will work fine with the "CRLF" string ending text files ,, but not "LF" only ...
I can take any of these problem files and open them in notepad and "save as" a new file,, and Harbour works fine because the saved file has "CRLF" at the end of each line instead of "LF" .......
I would like to know the proper instruction in Harbour to read these *nix style text files.
A long time ago I read about this on the net, but at the time I wasn't dealing with the issue.. Today, I can't find the information I read at that time.
Thank You,
Bill