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.
Reply
 
Thread Tools Display Modes
  #1  
Old 15th September 2011, 18: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
  #2  
Old 16th September 2011, 08: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
Default

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

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

Bookmarks

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 16:01
Shell script for "Perfect Server Debian Squeeze" Croydon Tips/Tricks/Mods 3 28th May 2011 09:00
Cannot login to phpmyadmin penkku HOWTO-Related Questions 1 24th February 2011 09:26
freebsd 7, samba 3, domain controller alexdimarco Suggest HOWTO 6 5th November 2010 16:54
Shell Script Execution Problem giganet Programming/Scripts 1 23rd December 2008 15:04


All times are GMT +2. The time now is 07:14.


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