![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Validation of character separated lines in a file | kolesunil | UNIX for Dummies Questions & Answers | 3 | 05-27-2008 03:48 AM |
| Remove Data from Fields | greengrass | UNIX for Dummies Questions & Answers | 4 | 01-15-2007 02:41 PM |
| How can i remove spaces in between the fields in a file | dsravan | Shell Programming and Scripting | 3 | 09-26-2006 01:11 PM |
| help me to remove the whitespaces between the lines ...urgent | kumar1 | Shell Programming and Scripting | 5 | 10-10-2005 05:51 AM |
| Splitting comma separated values into an array | tmarikle | Shell Programming and Scripting | 3 | 06-24-2005 02:50 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Remove whitespaces between comma separated fields from file
Hello all,
I am a unix dummy. I am trying to remove spaces between fields. I have the file in the following format 12332432, 2345 , asdfsdf ,100216 , 9999999 12332431, 2341 , asdfsd2 ,100213 , 9999999 & would like to make it 12332432,2345,asdfsdf,100216,9999999 12332431,2341,asdfsd2,100213,9999999 I would appreciate it greatly if there is a command to do this. Thanks Nitin |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
sed 's/ //g' infile > outfile Code:
awk '{$1=$1;OFS=""}1' infile > outfile
|
|
#3
|
|||
|
|||
|
The sed command did not give me what I was looking for but the awk worked great
Thanks a million NJ |
|||
| Google The UNIX and Linux Forums |