![]() |
|
|
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 |
| Multiple field separators in awk? (First a space, then a colon) | doubleminus | UNIX for Dummies Questions & Answers | 3 | 04-27-2008 04:28 PM |
| sh, ksh: command to remove front spaces from a string? | pseudocoder | Shell Programming and Scripting | 3 | 09-22-2007 08:57 AM |
| Remove Carriage returns between strings in a field | acheepi | Shell Programming and Scripting | 10 | 09-24-2005 02:19 PM |
| field delimiter with a space or more | uphamtn | UNIX for Dummies Questions & Answers | 3 | 05-15-2003 05:22 PM |
| How do you represent a field delimeter that is a space??? | TRUEST | UNIX for Dummies Questions & Answers | 1 | 05-04-2003 10:01 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
remove space in front or end of each field
Hi,
I have a txt file called a.txt which contain over 10,000 records and I would like to remove space before comma or after comma....like below: The input (for example two record 00001,00002): 00001,client,card limited ,02292,N ,162:41 , 192, 94.589000, 0.000000, 94.589000, 0.000000,0 , 0, 0.000000, 0.000000, 0.000000, 0.000000,162:41 , 192, 94.589000, 0.000000, 94.589000, 0.000000,SIG ,SIN 00002,client2,hello Corporation Limited ,02507,N ,1594:23 , 193, 332.890000, 0.000000, 332.890000, 0.000000,0 , 0, 0.000000, 0.000000, 0.000000, 0.000000,1594:23 , 193, 332.890000, 0.000000, 332.890000, 0.000000,AUS ,AUD output: 00001,client,card limited,02292,N,162:41,192,94.589000,0.000000,94.589000, 0.000000,0,0,0.000000,0.000000,0.000000,0.000000,162:41,192,94.589000, 0.000000,94.589000,0.000000,SIG,SIN 00002,client2,hello Corporation Limited,02507,N,1594:23,193,332.890000,0.000000,332.890000,0.000000,0 ,0,0.000000,0.000000,0.000000,0.000000,1594:23,193,332.890000,0.000000,332.890000,0.000000,AUS,AUD condition: - the 3nd field is a company name which may have space between each word. However, I just need to delete space at front and end split by "," - the last field like record no#1 "SIN" may contain a few space after "SIN", I also need to delete it as well. Please help and thanks!!!!! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|