Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Removing Control characters from file

  • 09-12-2002 11:02am
    #1
    Registered Users, Registered Users 2 Posts: 2,694 ✭✭✭


    Hi guys. I'm having a problem with a file that was originally created with MS notepad. It contains the carrage returns (^M). I am using Sco Unix and have always used g/^M/s///g which works, however it won't for this file for some reason. Anyone know another alternitive using SED etc? This is wreaking my head on a Monday morning.
    Thanks.


Comments

  • Registered Users, Registered Users 2 Posts: 7,521 ✭✭✭jmcc




  • Registered Users, Registered Users 2 Posts: 2,694 ✭✭✭Dingatron


    Excellent. My Monday morning blues are gone. That'll do nicely. Thanks jmcc for the quick reply. I owe u one :-)


  • Closed Accounts Posts: 741 ✭✭✭longword


    tr is a fun tool. In this case, tr -d '\r' should get the job done.


  • Registered Users, Registered Users 2 Posts: 2,694 ✭✭✭Dingatron


    Wow, so many tools so little time. Both sed and tr seem much better options than vi. Problem sorted. Still wonder why it wouldn't work with vi. Thanks again for the replys.


  • Registered Users, Registered Users 2 Posts: 1,393 ✭✭✭Inspector Gadget


    According to this page, SCO ships with unix2dos and dos2unix, so you could always just use them instead?

    Example:
    dos2unix <originalfile> <newfile>

    Gadget


  • Advertisement
Advertisement