![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sed query | gopsman | Shell Programming and Scripting | 4 | 02-03-2009 02:41 AM |
| & in SQL query | Lindarella | Shell Programming and Scripting | 3 | 10-09-2006 04:43 PM |
| Query In awk | raguramtgr | UNIX for Dummies Questions & Answers | 1 | 08-27-2004 11:00 AM |
| RPM Query | silvaman | UNIX for Advanced & Expert Users | 1 | 08-15-2003 07:56 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Query in awk
file "batsmen" contains
Bradman;Australia;52;6996 Gavaskar;India;124;10122 Sobers;West;Indies;93;8032 Border;Australia;109;8075 Miandad;Pakistan;97;7121 Gower;England;94;7023 Boycott;England;108;8114 My awk script contains awk '{FS=";"} {len=length($1)}; {printf("%s %d\n"), $1, len}' batsmen when i run the script i get an output like this Bradman;Australia;52;6996 25 Gavaskar 8 Sobers 6 Border 6 Miandad 7 Gower 5 Boycott 7 i need the first row as "Bradman 7" but it is not working with this script. What should i do to rectify this. More over when to use "BEGIN & END" replies appreciated. raguram r |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|