![]() |
|
|
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 |
| replace space or spaces in a line of a file with a single : | NewSolarisAdmin | Shell Programming and Scripting | 5 | 01-27-2009 02:48 PM |
| Consecutive spaces within input being converted to single space | NinersFan | Shell Programming and Scripting | 4 | 09-04-2007 09:59 AM |
| Replace blank spaces by single tab, and right alignment | Jae | Shell Programming and Scripting | 1 | 08-08-2007 11:58 PM |
| How to use more than one MPE command STREAM with Unix command in a single shell? | bosskr | HP-UX | 1 | 10-16-2006 05:16 PM |
| How to use more than one MPE command STREAM with Unix command in a single shell? | bosskr | Shell Programming and Scripting | 0 | 09-19-2006 10:44 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
can v add 'n' of spaces by a single command?
Hi All,
I just need to check for 'tabs' in my input file and need to replace all tabs into 'n' no. of spaces. Say for example if I give NO_OF_SPACE=5, then it should replace all tabs with 5 spaces abc.in ##### asdasdasd \t\t\tasjkalskdl;asdsdjfksldfjklsdfxcmxm,cv \t\t\t\t\t\taskjdkasdjkqwexc209384 \tasjask; skldfklsdf say my space count : 2 then my output file should come like below abc.out ###### asdasdasd asjkalskdl;asdsdjfksldfjklsdfxcmxm,cv askjdkasdjkqwexc209384 asjask; skldfklsdf I know this command will work : perl -pe 's/[\t]/\ \ \ \ /g' abc.in But here I hard coded with 4 sapces. How can I modify the above code as generic?? Thanks in advance saravana Last edited by askumarece; 06-12-2009 at 06:25 AM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|