richsark
asked on
txt file all screwed up ^M and no carriage returns at each line
Hello Folks
I have a text file. I look at it using my Mac, I see that it has ^M everywhere
Looks like this:
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:
Is there a shell script or even a perl script that I can fix this up?
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?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Another option is to open the file in vim and :set fileformat=unix. If you don't have vim then you can open it in vi and do :%s%^M%^M%g (with both ^M being ctrl-V ctrl-M) - at least that replace works in vim. I think the same replace should work in sed as well (though I always forget the switch to make sed do an inline edit).
ASKER
I appreciate the quick turn around !