![]() |
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 |
| 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 |
| record count | dr46014 | Shell Programming and Scripting | 4 | 12-11-2007 04:39 PM |
| How to count the record count in an EBCDIC file. | oracle8 | UNIX for Dummies Questions & Answers | 1 | 07-26-2006 07:22 PM |
| Manipulating fields record wise | rinku11 | Shell Programming and Scripting | 1 | 12-07-2005 10:42 AM |
| awk: record has too many fields | chaandana | Shell Programming and Scripting | 3 | 07-29-2005 01:03 PM |
| How to screen each variable record for right # of fields | jvander | Shell Programming and Scripting | 3 | 04-27-2005 10:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How count number of fields in a record
Dear All ,
I have the query cat temp.txt |28-07-1997|IF_LEG_DCCT|TOV JV sdfsdfdsfdsfdsCLOSED* KIEV|381015280 I need to count the number of fields in this pipe-seperated file. I beleive this is possible via AWK command. The in above file, output of the count should be 5.... Can some-one please help me with this Thanks Suresh |
|
||||
|
Hii..
It is still not giving me correct results $ cat temp.txt |05-12-2003|IF_LEG_ACCT|TOV FOREST ...CLOSED... UA|966423631|Delete|||||N||||||Y|TOV FOREST ...CLOSED... UA|IEV Ukraine Sales UA|||UAA9664236310|UACO9664236310|06-04-2005||||IEV||UASLQ|1-2FSYM-240|06-09-2007||||||||||||LA|JHP UA|IF_LEG_ACCT |28-07-1997|IF_LEG_ACCT|TOV JV KIEV|381015280|Delete|||||N||||||Y|TOV JV PARMATSIYA UKRAINE *CLOSED* KIEV|IEV Ukraine Sales UA|||UAA3810152800|UACO3810152800|27-06-2001||||IEV|UUU|UASLQ|1-2FM9I-391|05-09-2007||||||||||||UA|JHP PA|IF_LEG_ACCT $ awk '{ print NF+1 }' temp.txt 12 16 Can you please advice Regards Suresh |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|