Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Editing Text file - need to replace ^M (ascii 13)

  • 28-08-2003 03:37PM
    #1
    Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 97,532 Mod ✭✭✭✭


    I've a file that I need to import.

    Only problem is it uses ^K as end of line and ^M as end of record.

    It's easy enough to change the ^K to a ^J and it sorta looks ok ^M^J would be better though.

    And the editors I usually use can't tell the difference between pressing enter and ALT-13

    (Have tried Control-P followed by Control-M - this used to work )

    So any one know a good text editer that will allow replacement of any of the 256 asciii chars ?? or any other trick I can use ??

    (I've tried Excel / open office import but records get trucated at 255 bytes :( )

    (back in the 80's I'd have used sidekick but it don't run on windows and anyway the file is too big.)


Comments

  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 97,532 Mod ✭✭✭✭Capt'n Midnight




  • Registered Users, Registered Users 2 Posts: 4,236 ✭✭✭Quigs Snr


    Another one you could use is VEDIT


  • Registered Users, Registered Users 2 Posts: 19,607 ✭✭✭✭sceptre


    Originally posted by Capt'n Midnight
    http://www.winvi.de/en/download.html
    Ah, Vi, the programmer's torture of choice.

    I can't stand it myself but maybe the windows version doesn't cause you to tear out hair and throw things


  • Registered Users, Registered Users 2 Posts: 153 ✭✭crowbar


    i swear by editplus for my windows text editing needs. best text editor ever, has almost everything i've ever wanted to do with text.


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 97,532 Mod ✭✭✭✭Capt'n Midnight


    It is basically Notepad with a few extra buttons.

    It's also GNU and comes with source code.

    it is a notepad replacement - which allows you to view, edit / replace in ASCII , EBDIC and HEX

    niggles - you can't replace until you've done a find
    and if the replacement string contains more than one copy of the search string it may go into a loop (just click cancel)


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 6,265 ✭✭✭MiCr0


    to remove this in unix anyway..............

    vi file_name.blah

    Press escape
    Then
    :
    %
    s
    /
    ctrl-v ctrl-m (which will produce ^M)
    //
    g

    The line should look like
    :%s/^M//g

    and press enter


Advertisement
Advertisement