Do we have a simple, straightforward way to fix files with the abominable DOS line endings? In other words, to get rid of the "\r" characters.
Amazing after all these years that I have never had to cope with this before...
I know that there are bash ways of doing it, but
"dos2unix" is not ubiquitous.
the "sed" way is witchcraft (IMPO)
cat <file> | tr -d '\r' is the most elegant but looks terrible in File.Load(Shell(cat <file> | tr -d '\r'>temp$ ( ... blah blah blah
To put it simply, if I load the file all the "\r" characters remain and screw up my parsing of the file. I just want to make them "go away with extreme prejudice".
tia
b
DOS line endings
DOS line endings
Have you ever noticed that software is never advertised using the adjective "spreadable".
Re: DOS line endings
Ehmmm... what if you used the native Gambas function Replace() ?
https://gambaswiki.org/wiki/lang/replace
https://gambaswiki.org/wiki/lang/replace
Europaeus sum !
Amare memorentes atque deflentes ad mortem silenter labimur.
Amare memorentes atque deflentes ad mortem silenter labimur.
- BruceSteers
- Posts: 1608
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: DOS line endings
Yep , I'm with Vuott on this
sNoCR = Replace(File.Load(sDosFileName), "\r", "")
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: DOS line endings
Probably because I didn't think of it.
Thanks guys.
b
Thanks guys.
b
Have you ever noticed that software is never advertised using the adjective "spreadable".