Well, the regexp for the last character in a line is:
Therefore:
This gives you all the last characters, uniquely, plus a "$", which will constitute the regexp for exactly this character. You now use this tempfile as input for "grep" with the "-c" (count) option:
Hi,
I want to get a Line count of a file and append that at the end of the file. The Line count should not include the Headers :
------------------
COL1,COL2,COL3
123,abc,011
111,abd,0212
Record Count: 2
-------------------
Thanks. (7 Replies)
leviathan:/lcl/apps/Tivoli/netcool/omnibus/bin>more pmonfile.dat
entp_stdby
ot1p_stdby
lawp_stdby
I am wonder how to remove the _stdby from all the values in this dat file using #!/bin/ksh
Thanks! (4 Replies)
Hi,
I have a file where I need to count the total for the first element and put it back at the end of file...
here is the example...
input..
FHDR|ABC|20100607|
|ABC|8453|CDE|E166||||
123|ABC|8453|CDE|E166||||
123|ABC|8453|CDE|E166||||
111|ABC|8453|CDE|E166||||... (8 Replies)
Hi
I have the following info in a file -
<Cell id="25D"/>
<Cell id="26A"/>
<Cell id="26B"/>
<Cell id="26C"/>
<Cell id="27A"/>
<Cell id="27B"/>
<Cell id="27C"/>
<Cell id="28A"/>
I would like to know how would you go about counting all... (4 Replies)
I am looking help in awk, quick overview. we will get feed from external system . The input file looks like below.
Detail Id Info Id Order Id STATUS Status Date FileDetail
99127942 819718 CMOG223481502 PR 04-17-2011 06:01:34PM... (7 Replies)
Hi All,
test file
Begin Script Run at Thu Mar 14 09:24:16 PDT 2013
tst_accounts: ws zip: WS_out_20130313.tar.gz dat: test_20130313.dat count: 63574 loaded: xx pre-merge: xx post-merge: xx timestamp: Thu Mar 14 09:30:42 PDT 2013
tst_accounts: ws zip: WS_out_20130313.tar.gz dat: s_20130313.dat... (6 Replies)
Hello fellow awkers and seders:
need to figure out a way to ensure a software deployment has completed by checking its trace file in which I can store the deployment results as follows:
echo $testvar
===== Summary - Deploy Result - Start ===== ===== Summary - Deploy Result - End =====... (1 Reply)
Hi I have a file with contents like :
101,6789556897,0000795369 - seq - fmt_recs187] - avg_recs
101,4678354769,0000835783 - seq - fmt_recs98] - avg_recs
221,5679787008,0001344589 - seq - fmt_recs1283] - avg_recs
I need to find the sum of the all the values (which are in bold).
here... (6 Replies)
Hi guys,
I have to append the word count of a file at the end of the file name like this - > "filename_2345" where 2345 is the word count of "filename". How do i achieve this using one command ? I am not allowed to store the word count in a variable and then concatenate. Request your... (1 Reply)
In the below perl I am trying to extract and print the values AF1=, the GT value, and F or QUAL diveded by 33 (rounded to the nearest whole #). The GT value is at the end after the GT:PL so all the possibilities are read into a hash h, then depending on the value that is in the line the... (1 Reply)