How to remove all carriage return in a TXT file

June 10, 2017 at 22:21:33
Specs: Windows 7
How I can remove carriage return in a file. When I check the carriage return in one of my .txt file with [\r\n]+, i got 2 counts. I am using this .txt file in windows and need to get rid of these 2 carriage returns which is causing me issue. Also just wondering if I need to share the file content to help.

See More: How to remove all carriage return in a TXT file

Report •

#1
June 10, 2017 at 23:03:14
What software are you using to create the txt files? With notepad you can just enable 'word wrap' and never hit the carriage return except at the end of a paragraph. To remove carriage returns already in a document I think you'd have to delete them one at a time.

Report •

#2
June 11, 2017 at 00:27:44
I can recall having to do this eons ago, but couldn't rcall exact syntax... So I dun a wee trawl and found this - worth to check against your syntax as posted here:

http://preview.tinyurl.com/y8wnvjht

It's very slightly different to yours as posted - note the first character..

And this link has a few assorted approaches:

http://tinyurl.com/y997be76

message edited by trvlr


Report •

#3
June 11, 2017 at 07:17:01
Windows programs should be handle Windows native \r\n line endings without issue, so what are you trying to do with this text file? Are you trying to use it on a Linux box, or feed it into some poorly ported Linux program? Recommendations will change based on what's happening, and if you need something easily repeatable.

Unrelated but trvlr, why do you keep hiding your links behind tinyurl? This isn't Twitter. You're not limited to 140 bytes. I mean, I wrote a script to expand shorted URLs, and I named it "trvlr.ps1".

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
June 11, 2017 at 08:20:01
@ Razor2.3

Some of the links one may wish to post are "rather long..."; and on occasion I have been aware that "some" phoklks find they can't open the long version. Also I noted that many others here use tiny.url on a regular basis; and decided that if if it's OK for them (and those pholks are olde timers here) I'd do the same - some of the time.

Whenever I see a tiny.url link here I find it very easy to open it (I just click on it) - as/when required...

Incidentally was there ever another version/edition, or is there a more recent version/edition, of Razor; or is 2.3 the only one?


Report •

#5
June 11, 2017 at 08:43:37
Well, someone on this site called me Razor 2.5 before, so I guess I'm the outdated version?

The actual joke has long since past, but once upon a time, I was playing on a Quake 2 server with two other Razors. My friends were joking that it was hard telling the three of us apart, and, one of the Razors was spending all of his time complaining about how there were all these pretenders trying to pass themselves off as him.

"Fi~ne. I renamed myself '2.3.' Let's see someone copy that." Afterwards, the explanation was that I was a Quake bot that escaped the game and was free on the Internet.

How To Ask Questions The Smart Way

message edited by Razor2.3


Report •

#6
June 19, 2017 at 09:47:15
This file which will be picked up by a batch job and will be carried on windows environment

message edited by rkptcs


Report •

#7
June 19, 2017 at 10:14:14
If this file is being processed in Windows, then that means you're looking to replace all UNIX/Linux line endings with with Windows line endings, correct?

How To Ask Questions The Smart Way


Report •

#8
June 19, 2017 at 10:29:34
I can send if there is any way to submit the file or share the screencapture

Report •

#9
June 19, 2017 at 12:34:35
Well if it's about line endings in text files, I have plenty of examples already. What I need is an answer to this question: If this file is being processed in Windows, then that means you're looking to replace all UNIX/Linux line endings with with Windows line endings, correct?

EDIT: You know what? I'm just going to assume whatever you intend to do with this file requires all line endings to be Windows style, since I've already answered that question back in 2011. https://www.computing.net/answers/p...

How To Ask Questions The Smart Way

message edited by Razor2.3


Report •

Ask Question