TXT Unix To Dos

Post Reply
User avatar
miragerr
Posts: 140
Joined: Tue Oct 11, 2005 2:36 am
Location: Brasil

TXT Unix To Dos

Post by miragerr »

Hello friends,

I get a TXT file in UNIX format, how to open it to read the file in the DOS format by Fivewin, I tried with ttxtfile, more does not have the lines breaks

Is there any way to read the file?

I'll be waiting.
Jackson Douglas C. Brito
Boa Vista - RR - Brasil
FWH 12.09 Last Build
xHarbour Free
UESTUDIO
SQLRDD
Jack
Posts: 290
Joined: Wed Jul 11, 2007 11:06 am

Re: TXT Unix To Dos

Post by Jack »

Hi,
I think that unix use only chr(10) and not chr(13)+chr(10) .
Replace CHR(10) with CHR(13)+CHR(10) .

Try it,

Philippe
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: TXT Unix To Dos

Post by cnavarro »

Use function hb_eol()
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
miragerr
Posts: 140
Joined: Tue Oct 11, 2005 2:36 am
Location: Brasil

Re: TXT Unix To Dos

Post by miragerr »

How ?

oFile := TTxtFile():New( cFileName ) << File is Unix Code or UTF-8 not BOM

Do While !oFile:Eof()
cLine := oFile:ReadLine() // << here is the problem
? cLine
oFile:Skip()
Enddo
Jackson Douglas C. Brito
Boa Vista - RR - Brasil
FWH 12.09 Last Build
xHarbour Free
UESTUDIO
SQLRDD
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: TXT Unix To Dos

Post by nageswaragunupudi »

Code: Select all | Expand

cText    := MEMOREAD( cFile )
aLines   := HB_ATokens( cText, CHR(10) )
XBROWSER aLines
 
Regards

G. N. Rao.
Hyderabad, India
Post Reply