troubleshooting Question

txt file all screwed up ^M and no carriage returns at each line

Avatar of richsark
richsarkFlag for United States of America asked on
ProgrammingPerlShell Scripting
5 Comments3 Solutions404 ViewsLast Modified:
Hello Folks

I have a text file. I look at it using my Mac, I see that it has ^M everywhere

Looks like this:
conf    network delete  fixed   10.77.1.1 view default^Mconf    network delete  fixed   10.77.1.2 view default^Mconf    network delete  fixed   10.77.1.3 view default^Mconf

I need it to be Space delimited, not TAB and without the ^M's and I also need carriage returns after each line.

So... It should look like this:

conf	network	delete	fixed	10.77.1.2 view default
conf	network	delete	fixed	10.77.1.3 view default

Is there a shell script or even a perl script that I can fix this up?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 3 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros