Shell script using sed or awk

Discussion in 'Programming/Scripts' started by sudhanshu12788, Sep 15, 2011.

  1. sudhanshu12788

    sudhanshu12788 New Member

    Hi, I want to read a file from the command line and remove all the spaces, tabs in it, replacing it with comma(,), and write it to a new file. can you help me out with this scenario.
  2. Mark_NL

    Mark_NL Member

    sed 's/\s/,/g' file.txt > file2.txt
    Last edited: Sep 16, 2011

Share This Page