please solve my problem.....
I am trying to count number of record in a file and then append a trailer to that file.
Trailer should e in the format as below
T| <count of records>
count of records ---> this count should be one less than the actual count obtained, as the file will have a header.
First post here, so hopefully all guidelines are followed, and thanks in advance for any replies.
I'm working on a shell script(BASH) that processes a csv file and performs various tasks with the data. All is well, except I want to use 'tee' to send output from 'wc' to a file as well as pipe it to 'cut'.
hi all,
i want script to print the output in the following format
filename yyyy/mm/dd count
where count= no.of records in the file
Thanks in advance
hemanthsaikumar
Hi All,
i am taking end of records using tail command got the out is "END OF FILE. ROW COUNT: 10"
and record count in the file is 3. while append the both data into test2.txt file,it's append like
Code:
END OF FILE. ROW COUNT: 108
my output should be in the test2.txt file
Code:
END OF FILE.
Hi all,
I have a tab-delimited text file of size 10Mb. I am trying to count the number of lines using,
Code:
grep -c . sample.txt
or
Code:
wc -l < sample.txt
or
Code:
awk 'END {print NR}' sample.txt
All these commands shows the count as 1, which means they are reading only the first header line of the file.
I am trying to search a file for a patterns ERR-[0-9][0-9][0-9][0-9][0-9] in a file and return a count for each of the error reported
Input file is a free flowing file without any format
example of output
ERR-00001=5
....
ERR-01010=10
.....
ERR-99999=10
Hi I have coded this bash script to count the number of tabs in file.but when i run the script i am getting this error. what
is the mistake i ve done?
line 5: syntax error: "(" unexpected
Code:-
#!/bin/sh
#
FILE='unit-1-slide.txt'
OUTPUTFILE='output-for'- $FILE'
COUNT=$(awk'{print gsub(/\t/,"")}' $FILE)
OUTPUT_PATH='/home/user/Desktop'
echo $COUNT >> $OUTPUTFILE
echo "Done!"
Hello,
I have some problem in counting char of word, sum and change.