dirtyholmes
Programmer
Hi Guys.
I am very new to perl, and require some assistance in a little problem I have.
I have 2 text files which have the following data
File 1
00242531 HOLLAND 4572357225 7722+09868603.0660966698
11242531 FRANCE 6454353535 7444+06779889.0668896669
54243351 CHINA 7676689998 2451+06988676.0966967977
9842665 DENMARK 8985543327 7851+06898966.3696669669
54242313 HUNGARY 4678777979 8967+06889660.4696798680
44446663 GERMANY 3546456557 8966+06896866.2689666693
File 2
00242531 HOLLAND 4572357225 2222+09868603.0660966698
11242531 FRANCE 6454353535 7444+06779889.0668896669
54243351 CHIN 7676689998 2451+06988676.0966967977
9842665 DENMARK 8985543327 7851+06898966.3696669669
54242313 HUNGARY 4678777979 8967+06889660.4696798680
44446663 GERM NY 3546456557 8966+06896866.2689666693
I want to compare the data from datafile1 to the data from datafile2. As I parse through the files, If the values on corresponding lines from each file are different, I wish to write the two lines with the differences to a new file, so I have a new file containing a the line from data file 1, alongside the same line from data file 2 (containing the difference ).
If the two lines match identically I wish to ignore them and move on.
Can anyone point me in a right direction. ?
I am very new to perl, and require some assistance in a little problem I have.
I have 2 text files which have the following data
File 1
00242531 HOLLAND 4572357225 7722+09868603.0660966698
11242531 FRANCE 6454353535 7444+06779889.0668896669
54243351 CHINA 7676689998 2451+06988676.0966967977
9842665 DENMARK 8985543327 7851+06898966.3696669669
54242313 HUNGARY 4678777979 8967+06889660.4696798680
44446663 GERMANY 3546456557 8966+06896866.2689666693
File 2
00242531 HOLLAND 4572357225 2222+09868603.0660966698
11242531 FRANCE 6454353535 7444+06779889.0668896669
54243351 CHIN 7676689998 2451+06988676.0966967977
9842665 DENMARK 8985543327 7851+06898966.3696669669
54242313 HUNGARY 4678777979 8967+06889660.4696798680
44446663 GERM NY 3546456557 8966+06896866.2689666693
I want to compare the data from datafile1 to the data from datafile2. As I parse through the files, If the values on corresponding lines from each file are different, I wish to write the two lines with the differences to a new file, so I have a new file containing a the line from data file 1, alongside the same line from data file 2 (containing the difference ).
If the two lines match identically I wish to ignore them and move on.
Can anyone point me in a right direction. ?