0

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.

5
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by deepkw
0

Hi sudhanshu!

This should be relatively simple with a search/replace in sed. What have you tried so far?

0

Using sed you can look for spaces and tabs [ \t] (extended regular expressions will allow modifiers to that). Then you can replace with a comma.
The general format of the sed search/pattern/replace is: s/PATTERN/REPLACEMENT/g I added the g on the end as it is a modifier to include all matches on a line, not just the first (something I think you want).

0

no every thing said is wrong please go ahed and let me know if you want any further information from me as senior scripting language progaramer

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.