Find the answer to your Linux question:
Results 1 to 3 of 3
i want to find a command line way to edit a text file to delete all commas in the file. i do not want to replace them w/ anything. can ...
  1. #1
    Just Joined!
    Join Date
    Oct 2007
    Posts
    10

    [SOLVED] edit text files - delete commas

    i want to find a command line way to edit a text file to delete all commas in the file. i do not want to replace them w/ anything. can anyone make any suggestions of a simple command line to do this.

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,100
    Code:
    sed s/,//g <TEXTFILE>
    This will *output* <TEXTFILE> without any commas.

    For actually modifying <TEXTFILE> with sed one parameter is missing.
    You will find it here
    Code:
    man sed
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Oct 2007
    Posts
    10
    thanks a bunch. it worked great and then i did another substitution and had my file all fixed up. i even fully automated the process in my data base

Posting Permissions

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