Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 15th September 2011, 19:23
sudhanshu12788 sudhanshu12788 is offline
Junior Member
Join Date: Sep 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Shell script using sed or awk

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.
Reply With Quote
Sponsored Links
Old 16th September 2011, 09:52
Mark_NL Mark_NL is offline
Senior Member
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts

sed 's/\s/,/g' file.txt > file2.txt

Last edited by Mark_NL; 16th September 2011 at 10:03.
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
question in shell script abood1190 Programming/Scripts 3 2nd September 2011 17:01
Shell script for "Perfect Server Debian Squeeze" Croydon Tips/Tricks/Mods 3 28th May 2011 10:00
Cannot login to phpmyadmin penkku HOWTO-Related Questions 1 24th February 2011 10:26
freebsd 7, samba 3, domain controller alexdimarco Suggest HOWTO 6 5th November 2010 17:54
Shell Script Execution Problem giganet Programming/Scripts 1 23rd December 2008 16:04

All times are GMT +2. The time now is 15:41.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.