![]() |
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 |
| Count number of occurences of a word | shikhakaul | UNIX for Dummies Questions & Answers | 8 | 06-25-2009 11:10 AM |
| number of occurences of a string | siddu_chittari | Shell Programming and Scripting | 12 | 12-05-2006 01:09 AM |
| Counting occurences of different strings in a file | Freerider | UNIX for Dummies Questions & Answers | 4 | 07-15-2005 10:27 AM |
| counting the number of lines | nayeemmz | Linux | 6 | 01-19-2005 12:37 PM |
| Counting occurences of specific charachter in a file | GMMike | UNIX for Dummies Questions & Answers | 3 | 10-13-2004 02:46 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Counting number of occurences
Hi All,
I have to count the number of occurences of the character " ; " in a given line. I had used the following awk command to achieve the same echo $KOP.dat|awk '{split($1,my,";"); for(i in my)c++ }END{print c-1}' My file KOP.dat had the following data 1;"A";"DUN";"405";"022837000";"LOT2";10;10;20;10;39;45;89;87;99;5654654;879878;20080327;"1015";"F1"; " ";"G";"04" The output given by the above command was 20 but I have 22 semi-colons in the line. The same utility worked good on some ealier occasions can some one please advice. Thanks KOP. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|