![]() |
|
|
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 |
| Count number of occurences of a word | shikhakaul | UNIX for Dummies Questions & Answers | 8 | 06-25-2009 12:10 PM |
| count occurences of specific character in the file | superprogrammer | HP-UX | 9 | 04-09-2008 12:05 PM |
| grep all records in a file and get a word count -perl | meghana | Shell Programming and Scripting | 4 | 02-13-2008 10:06 PM |
| How to print all lines that has exactly 3 occurences of digit 4 using grep? | sivasai83 | Shell Programming and Scripting | 3 | 01-31-2007 02:21 AM |
| How to count no of occurences of a character in a string in UNIX | kamesh83 | UNIX for Advanced & Expert Users | 11 | 03-17-2006 02:39 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi Folks,
I have a input file of the below format. ~~~OLKIT~OLKIT~1~~TBD~BEST PAGER & WIRELESS~4899 COMMON MARKET PLACE~~~DUBLIN~KS~43016~I~Y~DIRECT~D~~0 BPGRWRLS~~~OLKIT~OLKIT~1~~TBD~BEST PAGER & WIRELESS~4899 COMMON MARKET PLACE~~~DUBLIN~KS~43016~I~Y~DIRECT~D~~0 BPI~~~OLKIT~OLKIT~1~~TBD~CITI CONNECTION~6413 18TH AVE~~~BROOKLYN~KS~11204~~Y~DIRECT~D~~0 BPNABOF~~~OLKIT~OLKIT~1~~TBD~BRIGHTPOINT NORTH AMERICA~501 AIRTECH PARKWAY~~~PLAINFIELD~KS~46168~~Y~DIRECT~DT~~0 BRADSINC~~~OLKIT~OLKIT~1~~TBD~BRADSHAW INC~4662 HORN LAKE RD~~~MEMPHIS~KS~38109~I~Y~DIRECT~D~~0 BWRES07TM~~~OLKIT~OLKIT~1~~TBD~BLUEFISH WIRELESS INC.~6100 WEST 96TH ST., SUITE 140~~~INDIANAPOLIS~KS~46278~~Y~DIRECT~J~~0 BYFGRPTM~~~OLKIT~OLKIT~1~~TBD~BYF GROUP, INC.~4810 BEAUREGARD ST.~~~ALEXANDRIA~KS~22312~~Y~DIRECT~F~~0 In the input file I have many no of lines which have "~" symbols in them. In every line, I need to count the no. of times "~" occurs and compare it with a variable which is passed along with the shell script in the command line. I have highlited each line in diffn color. The command line format is shell_script input_file.dat 20 In the above line 20 is the no to which the no of "~" are compared Help is very much required as I am very new into shell scripting. Regards Srikanth GR Last edited by srikanthgr1; 04-20-2007 at 06:30 AM.. Reason: Needed to give more details. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|