10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have one text file
1 2 3
a 5
4 4 3
where i want to print the line number
while read line
do
line_no=`awk '{print NR, $0}'`
echo 'In line no $line_no'
done <$txt_file
If i run the above code, it will print
'In line no 1 1 2 3'
It prints the line number with the whole... (3 Replies)
Discussion started by: RJG
3 Replies
2. Shell Programming and Scripting
Hello,
I have been working on Awk/sed one liner which counts the number of occurrences of '|' in pipe separated lines of file and delete the line from files if count exceeds "17".
i.e need to get records having exact 17 pipe separated fields(no more or less)
currently i have below :
awk... (1 Reply)
Discussion started by: ketanraut
1 Replies
3. Shell Programming and Scripting
What I'm trying to accomplish. I receive a Header and Detail file for daily processing. The detail file comes first which holds data, the header is a receipt of the detail file and has the detail files record count. Before processing the detail file I would like to put a wrapper around another... (4 Replies)
Discussion started by: pone2332
4 Replies
4. Shell Programming and Scripting
hi,
How can i count the number of lines after the first line in a flat file in unix?
Say i have a flat file with a header like:
Student Name Student ID ....
Tnx (7 Replies)
Discussion started by: reignangel2003
7 Replies
5. Shell Programming and Scripting
Hi
I have the following file
ENST001 ENST002 4 4 4 88 9 9
ENST004 3 3 3 99 8 8
ENST009 ENST010 ENST006 8 8 8 77 8 8
Basically I want to count how many times ENST* is repeated in each line so the expected results is
2
1
3
Any suggestion please ? (4 Replies)
Discussion started by: fuad_
4 Replies
6. Shell Programming and Scripting
Hi All,
I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Discussion started by: mjavalkar
4 Replies
7. Shell Programming and Scripting
I have a text file which is having 30000 lines in it. I have to create a xml file for each 10000 lines until all the lines in the text files are written. Also please help how can i get number of lines in the text file in a shell variable? (19 Replies)
Discussion started by: vel4ever
19 Replies
8. Shell Programming and Scripting
dear all,
i need help about this case
i have line number extract in file fileA.txt like this:
231
123
444
231
213
...
now i want to compare the line number fileA.txt to find other file in fileB.txt
exp: if i use one by one like this:
cat fileB.txt | sed -n -e "444"p
huff...is not... (3 Replies)
Discussion started by: zvtral
3 Replies
9. Shell Programming and Scripting
Hi
I am using korn shell is there a built in or ny other way to get the current line number so i can write the current line number to the logfile to aid in debugging like
logmsg $lineno $date
logmsg is a helper function that helps in logging messages to a log file
regards (3 Replies)
Discussion started by: xiamin
3 Replies
10. Shell Programming and Scripting
Hi expert,
I using csh and i trying to compare no. of line of the file.
Example:
I have 2 files.
file1
ONE
TWO
THREE
FOUR
FIVE
file 2
ONE
TWO
THREE
FOUR
file1 have 5 lines but file2 have 4 lines. (1 Reply)
Discussion started by: vincyoxy
1 Replies