![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| csh script for deleting extra spaces in text file | hertingm | Shell Programming and Scripting | 2 | 03-12-2009 04:22 PM |
| Remove extra spaces in a line | vikas027 | Shell Programming and Scripting | 6 | 10-10-2008 11:07 AM |
| removing extra spaces | agarwal | Shell Programming and Scripting | 2 | 04-25-2008 05:54 AM |
| How can i remove spaces in between the fields in a file | dsravan | Shell Programming and Scripting | 3 | 09-26-2006 05:11 PM |
| To remove the extra spaces in unix | Sho | UNIX for Dummies Questions & Answers | 4 | 05-04-2006 06:58 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
remove extra spaces between fields
Hi,
I have a source file as mentioned below: I want to remove all the extra spaces between the fields. a b--------|sa df-------|3232---|3 sf sa------|afs sdf-----|43-----|33 a b c------|adfsa dsf---|23-32|23 *Here '-' idicates spaces Now, I want output as below: a b|sa df|3232|3 sf sa|afs sdf|43|33 a b c|adfsa dsf|23-32|23 How can i achieve this? Thanks, Sri |
|
||||
|
Hi,
Thanks for your quick reply, but im getting output as below using SED. a bsa df32323 sf saafs sdf4333 a b cadfsa dsf23-3223 and using "tr" iam able to delete extra spaces but getting one space(as mentioned below) after each field, which i dont want : a b |sa df |3232 |3 sf sa |afs sdf |43 |33 a b c |adfsa dsf |23-32 |23 please let me know where iam mistaken? Thanks, Sri |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|