FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Remove Line feeds
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Remove Line feeds
Posted: Wed May 02, 2018 12:30 PM

How can I remove line feeds from text?
I've tried cText = StrTran( cText, CRLF, CHR(13) )
Also tried cText = StrTRan( cText, CHR(10), "" )
but when I put the text in an Ascii checker (http://www.asciivalue.com/) it shill shows CHR 10

I've tried writing the file with MemoWrit() and FCreate()/Fwrite()

I'm stumped :(

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Remove Line feeds
Posted: Wed May 02, 2018 12:32 PM

Forgot to mention, I need just a CR at the end of each line.

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Remove Line feeds
Posted: Wed May 02, 2018 01:03 PM

Can you send me the text file to test here?

EMG

Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Remove Line feeds
Posted: Wed May 02, 2018 01:08 PM
Here is a link to the file.

www.can-soft.net/dlnew/sample.hl7
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Remove Line feeds
Posted: Wed May 02, 2018 01:55 PM

I can't see any CRLF or LF in that file.

EMG

Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Remove Line feeds
Posted: Wed May 02, 2018 02:08 PM

What are you checking it with?
When I paste the text into http://www.asciivalue.com/ it shows both chr(13) and chr(10)

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Remove Line feeds
Posted: Wed May 02, 2018 03:27 PM

Can you send me the txt file, please?

EMG

Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Remove Line feeds
Posted: Wed May 02, 2018 03:32 PM

Sent to your email

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Remove Line feeds
Posted: Wed May 02, 2018 04:39 PM

There is only one CR at the end of each line, no LFs. Please let me know where did you find a LF (at which offset) exactly.

EMG

Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Remove Line feeds
Posted: Wed May 02, 2018 04:48 PM

I think the issue is when I am looking at the file in notepad, ultraedit etc...
I ran some quick code to show me the values of each char and it only shows the CHR(13) at the end of the line and no CHR(10) so I think I'm good.
Thanks for looking into this with me.

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)

Continue the discussion