![]() |
|
|
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 |
| how to exclude the GREP command from GREP | yamsin789 | UNIX for Advanced & Expert Users | 2 | 10-05-2007 03:59 AM |
| Grep | pankajkrmishra | Shell Programming and Scripting | 15 | 09-01-2006 03:00 AM |
| Make grep -c display like grep -n? | Jerrad | Shell Programming and Scripting | 2 | 08-25-2006 01:20 AM |
| grep pls help.. | esham | Shell Programming and Scripting | 19 | 03-17-2005 06:44 AM |
| Grep/Sed help? | CKS | Shell Programming and Scripting | 3 | 03-19-2004 06:49 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi Srikanth,
Consider below:- test___1 test___2 test__10 test_110 Thease are the contents of a file where the number column is right aligned. Please consider "___" symbol as blank spaces. If I want to extract "test 110", I give grep "test $no" where no is a variable and consider now it is 110. This will extract "test 110". If I want to extract "test 10", If I give the same command grep "test $no", where no is 10, It won't extract because of it has got 2 blank spaces between test and 10. So I need to have a option like LPAD in other languages, E.g. LPAD("10",3," ") will return 1 blank space followed by 10. So I can assign this value to a variable and now the value can be no=" 10". Now I can go with grep, It will work. I hope you understood this. Any suggestion on this? TIA -Harish Last edited by harish_oty; 10-03-2006 at 06:27 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|