Results 1 to 7 of 7

Thread: Removing characters from a file..

  1. #1
    Mentor Stuart's Avatar
    Join Date
    May 2002
    Location
    nb.ca
    Posts
    1,087

    Removing characters from a file..

    Okay, so, somehow, this perl script I'm working on gets like 1 million plus signs in it, and gets saved. Don't ask how, I'm not sure. Autosave feature or something. Anyway, the file won't load because of how many there are, so I need some way to get rid of them. Help?

  2. #2
    Mentor Stuart's Avatar
    Join Date
    May 2002
    Location
    nb.ca
    Posts
    1,087

    Re:Removing characters from a file..

    Yea, it's just line 145. About a million, give or take. +++++ times a lot. Gah.
    Okay, fired up nano. I guess there are only just over 100,000 + signs on that line. I'm either gonna be sitting on the delete key all night, or. something. help!

  3. #3
    Mentor Stuart's Avatar
    Join Date
    May 2002
    Location
    nb.ca
    Posts
    1,087

    Re:Removing characters from a file..

    Okay guys, that was close, but sed saved my ass there.
    sed '145d' badfile.pl > goodfile.pl

  4. #4
    Advisor Outlaw's Avatar
    Join Date
    May 2001
    Location
    Clifton Park, NY
    Posts
    630

    Re:Removing characters from a file..

    Ok that's better than

    Code:
    sed 's/+\+//' script >newscript
    But wouldn't going into vim and doing a dd on the line work too?

  5. #5

    Re:Removing characters from a file..

    That's what I was thinking...
    I hate how gentoo makes nano the default $EDITOR...

  6. #6
    Mentor Stuart's Avatar
    Join Date
    May 2002
    Location
    nb.ca
    Posts
    1,087

    Re:Removing characters from a file..

    It would, but I don't have vim installed. I try to run a clean system
    Seriously, vim is just a little too complicated for me to remember how to use. I should learn though.

  7. #7

    Re:Removing characters from a file..

    I don't use VIM, I use elvis.

Similar Threads

  1. Exporting Visio Diagrams in Other File Formats
    By The Donald in forum Windows - General Topics
    Replies: 1
    Last Post: 07-08-2005, 12:55 PM
  2. How to use the Sysprep tool
    By CoolJsa14 in forum Windows - General Topics
    Replies: 0
    Last Post: 01-05-2005, 08:34 PM
  3. File Formats Supported by Windows Media Player
    By regix in forum Windows - General Topics
    Replies: 0
    Last Post: 01-03-2005, 10:17 PM
  4. Calling all mail server admins
    By demian in forum Linux - Hardware, Networking & Security
    Replies: 4
    Last Post: 04-21-2004, 08:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •