Hi,
I used to count number of fields using following command
HTML Code:
head -1 <filename> | awk -F"," '{print NF}'
Now the scenario is the delimiter(comma) occurs inside one of the data field. How to ignore the comma inside data and consider only delimiter and count number of fields.
I try to count number of lines of a data.txt file and then if number of lines is greater than 1 then email me the file.
I could not find what is wrong with my code, hope you can point out the mistake i made
Code:
#!
I have a comma (,) delimited file.
Code:
106232145,"medicare","medicare,medicaid",789
I would like to count the number of fields in each line.
I tried the below code
Code:
awk -F ',' '{print NF-1}'
This returns me the result as 5 instead of 4.
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,
i am trying to count the fields in a file.
Hi Guys,
I am getting count from a file (pipe delimited).
Code:
"23"|"9896"|"20090101"|"New Load"
I am using the following code to get the first two counts.
Code:
CtrlFileByte=`/bin/gawk -F"|" '{ print $1 }' $ControlFile`;
CtrlFileCnt=`/bin/gawk -F"|" '{ print $2 }' $ControlFile`;
But the problem is file Byte is not mand
Hi All, I have a file. This file contain huge amount of data. I want to modify this file. I want enter new line when count of "~ character is 79.
I have a delimited file (by |), and the second field is made out of Surnames.
Is it possible to list the surnames together with their count of occurances.
For example, image the first two lines are the following:
Code:
Joe | Doe | 30
Jane | Doe | 28
Peter | Smith | 25
John | Jones | 26
I would like an answer like the following
Code:
Doe 2
Smith 1
Jones 1
I managed to list the surna
Hi,
I wanted to create a control file with data in it.
Also wanted to append more points like
1)Row count, then print the first field
2)first line of the file
3)last line of the file
I started with this:-
Code:
ls -ltr *.*| awk ' { print $9 "|" $7 $6 $8 "|" $5 } '
sed -n '1p';
sed -n '$p';
Moderator's Comments: