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
Append from myfile.txt SDF
Moderator: Rathinagiri
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: Append from myfile.txt SDF
Ohhh no, this is not correct. Harbour also has this diferance. Just set this:DenCo wrote:Harbour will work fine with the "CRLF" string ending text files ,, but not "LF" only ...
SET( _SET_EOL, CHR(10) )
More details about this in: http://www.pctoledo.com.br/forum/viewto ... rom#p73188 (it is a portuguese forum, but you will find a button option for English/Espanish translations in upper of page site).
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Append from myfile.txt SDF
Olá Pablo
![Smile :)](./images/smilies/icon_e_smile.gif)
I didn't know SET( _SET_EOL, ... ) and thinking a program to convert LF to CRLF ...
Like "Captain Kirk" me too thanking you ;
Thanks for this tipPablo César wrote:... this is not correct. Harbour also has this diferance. Just set this:
SET( _SET_EOL, CHR(10) )
...
![Smile :)](./images/smilies/icon_e_smile.gif)
I didn't know SET( _SET_EOL, ... ) and thinking a program to convert LF to CRLF ...
Like "Captain Kirk" me too thanking you ;
Viva INTERNATIONAL HMG ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Thank You -> Re: Append from myfile.txt SDF
Thank You Pablo.....
Oh,,, I new HB would handle it ... I just could not find the setting !!!!!
I will now go read all about it .... Thanks again, and also (hi esgici)
Bill
Oh,,, I new HB would handle it ... I just could not find the setting !!!!!
I will now go read all about it .... Thanks again, and also (hi esgici)
Bill
-
- Posts: 388
- Joined: Wed Nov 21, 2012 7:14 pm
- Location: México
Re: Append from myfile.txt SDF
Hola Cesar....
En verdad eres un mago...
Saludos
Polo
En verdad eres un mago...
![Surprised :o](./images/smilies/icon_e_surprised.gif)
Saludos
Polo
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Append from myfile.txt SDF
Leopoldo Blancas wrote:Hola Cesar....
En verdad eres un mago...![]()
Saludos
Polo
Yes, agreedGoogle wrote:You really are a magician
![Smile :)](./images/smilies/icon_e_smile.gif)
Magic is knowing unknown
![Wink ;)](./images/smilies/icon_e_wink.gif)
Viva INTERNATIONAL HMG ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)