![]() |
|
|
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 |
| Sequence number generation on a key column | sbasetty | Shell Programming and Scripting | 6 | 03-27-2008 12:09 PM |
| column number, awk, help | jkl_jkl | Shell Programming and Scripting | 2 | 03-15-2008 10:16 PM |
| Identifying the column number | pondlife | Shell Programming and Scripting | 2 | 09-28-2007 11:43 AM |
| awk to select a column from particular line number | mab_arif16 | Shell Programming and Scripting | 4 | 05-08-2006 06:26 AM |
| printf returning unknown number | m0nk3y | Shell Programming and Scripting | 1 | 08-08-2005 12:31 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
returning a column number
Hi all,
i was doing a small program where if i was to be given the first 3 letters of any month i.e. in the form of Jan or Apr then it would return the column number where it finds a match. To do this i created a 12 element array of months with first 3 letters and if i echo'ed the contents of the array, piped it into another command that would return me a column number where it matched. i thought awk could do this by replacing 'print' with 'find' but it doesn't work although it doesn't give an error message. Is there a command already out there that does this? thanks Mani |
|
||||
|
Hi,maybe this can help you
I suppose you want to scan a file, and then find the file's line which contain Abbrevision for MONTH, and then print the line's line number. Follow maybe can help u, just for you reference: The file content(a.txt): Code:
this is Mar now come a Feb then another Mar he a Jun comes The script: Code:
read mon
echo "The line number which contain ${mon} is as follow:"
sed "/$mon/=" a.txt
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|