counting the lines of diff files in loop


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting counting the lines of diff files in loop
# 1  
Old 01-09-2009
counting the lines of diff files in loop

i have two file.


i want to count the lines of each file one by one in loop and compare it.

can any one pls help me on this?
# 2  
Old 01-09-2009
What have you tried so far?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Diff 3 files, but diff only their 2nd column

Guys i have 3 files, but i want to compare and diff only the 2nd column path=`/home/whois/doms` for i in `cat domain.tx` do whois $i| sed -n '/Registry Registrant ID:/,/Registrant Email:/p' > $path/$i.registrant whois $i| sed -n '/Registry Admin ID:/,/Admin Email:/p' > $path/$i.admin... (10 Replies)
Discussion started by: kenshinhimura
10 Replies

2. UNIX for Dummies Questions & Answers

Loop Counting Question

I figured this out, but I wanted to pose the question. I was writing a while loop that required counting the amount of times the job had run, for example. An example below is what I had: variable=0 while : do variable = `expr $variable + 1` done That didn't do what I... (4 Replies)
Discussion started by: phunk
4 Replies

3. Shell Programming and Scripting

Help in replacing two blank lines with two lines of diff data

Hi.. I'm facing a trouble in replacing two blank lines in a file using shell script... I used sed to search a line and insert two blank lines after the searchd line using the following sed command. sed "/data/{G;G;}/" filename . In the file, after data tag, two lines got inserted blank lines..... (4 Replies)
Discussion started by: arjun_arippa
4 Replies

4. Programming

trouble with loop counting

HI there, I am trying to count manually what this code does but I am stuck and I don't learly see the result. The code works and it compiles and runs but I just don't follow the value of var. #include<stdio.h> #include<stdlib.h> #include<sys/types.h> #include<unistd.h> #include<wait.h>... (2 Replies)
Discussion started by: bluetxxth
2 Replies

5. Shell Programming and Scripting

loop through lines and save into separate files

I have two files: file-gene_families.txt that contains 30,000 rows of 30 columns. Column 1 is the ID column and contains the Col1 Col2 Col3 ... One gene-encoded CBPs ABC 111 ... One gene-encoded CBPs ABC 222 ... One gene-encoded CBPs ABC 212 ... Two gene encoded CBPs EFC... (7 Replies)
Discussion started by: yifangt
7 Replies

6. Shell Programming and Scripting

Counting lines in multiple files

Hi, I have couple of .txt files (say 50 files) in a folder. For each file: I need to get the number of lines in each file and then that count -1 (I wanted to exclude the header. Then sum the counts of all files and output the total sum. Is there an efficient way to do this using shell... (7 Replies)
Discussion started by: Lucky Ali
7 Replies

7. Shell Programming and Scripting

diff lines from 2 files in a while loop

Okie I have two files. file1 with input asdf_s45 fdsa_s20 jkl_s32 lkj_s3 and file2 with input asdf_s44 fdsa_s19 jkl_s31 lkj_s2 now I have counted the total number of lines in the file and put it in a variable so num_lines=4 now I have a while loop to repeat a diff command... (6 Replies)
Discussion started by: bigboizvince
6 Replies

8. Shell Programming and Scripting

Merging files with AWK filtering and counting lines

Hi there, I have a couple of files I need to merge. I can do a simple merge by concatenating them into one larger file. But then I need to filter the file to get a desired result. The output looks like this: TRNH 0000000010941 ORDH OADR OADR ORDL ENDT 1116399 000000003... (2 Replies)
Discussion started by: Meert
2 Replies

9. UNIX for Dummies Questions & Answers

Counting lines and files

Hi experts, First of all thanks for all your help. How can i count the lines within a text file and send this number to another text file? And by the way how can i count the number of files inside a tape ("/dev/rtp") that as one pattern (Ex. "/CTA/") and send this number to a text file? I... (6 Replies)
Discussion started by: jorge.ferreira
6 Replies

10. Shell Programming and Scripting

diff 2 files; output diff's to 3rd file

Hello, I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3. For example: file 1 123 1234 123456 file 2 123 2345 23456 file 3 should have 2345 23456 I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
Discussion started by: blt123
2 Replies
Login or Register to Ask a Question