How to do row comparison in shell script

Hi,

I need help on doing the below thing in shell script.

I have a file with millions of rows called "abc.txt". i have another file with millions of rows called "xyz.txt".

I would like to do the below operation.
Open the abc.txt, read the first line, do some operations on the column values and hold it in temp variable. Open the the xyz.txt and read the first line and do some operations on the column values and hold it in temp variables.
Write this temp values to the output file.
The major hiccups in this is i have to compare the first row of abc.txt with the first row of xyz.txt and second row to the second row and so on.

How can i do the comparison of first line with first line and second line with second line and so on ?

if you define 'some operations' we can show you a simple way to do this is awk. It is also possible in bash. But it depends on what the data is like.

We need sample lines from "abc.txt" and samples line from "xyz.txt" - then show us what 'some operations' means.

Let us consider the abc.txt have following lines
20010203000010100000100014716000002968
20010203000010100000100017416000002968
20010203000010100000100017416000002968
20010203000010100000100014716800002968

Let us consider the xy.txt have the following lines
20010230000010100000100014786000002968
20010021000010100000100017486000002968
20010022000010100000100017486000002968
20010203000010100000100014796800002968

I have to read the first line from both the files and
check if the dates (first 8 characters) are same in both the files
if same then i will proceed the fetching of other values.
If dates are not same then quit that record.

Move to second line in both the files and do the process again.

by

Srini