Hi,
I am writing a comparator script, which comapre two txt files(column by column)
below are the precondition of this comparator
1)columns of file are not seperated
Ex.
file1.txt
8888812341181892
1243548895685687
8945896789897789
1111111111111111
file2.txt
9578956789567897
8945789789567894
5789567895678967
1111111111111111
where charactr 1-5 if field1
character 6-9 is field2 etc.
second file is also same structure. but the filed1 of file1 may differ from field1 of file2.
2) Field_Desc.csv
the position of fields is taken from third file (just call it Field_desc.csv)
from this file => we can take a field position and its length
Ex.
FIELD1|OFFSET|LENGTH
My question:
1) i am reading all files, but how to cut a specific column of a file(not line by line). I need entire column in a seperate variable.
Ex.
field1 of file1
88888
12435
89458
11111
field1 of file2
95789
89457
57895
11111
=> I am not getting above result.
2) now I will perform the diff command or check line1 of file1 is equal to line1 of file2. need result as below
Ex.
field1_of_file1 field1_of_file2 Result
88888 95789 "Error not equal value"
12435 89457 "Error not equal value"
89458 57895 "Error not equal value"
11111 11111 "Files has same value"
3) Script is executed as below
perl Script_compare.pl File1.txt File2.txt Filed_Desc.csv
and result must be writeen in another file "Result.log"
please help me. I was in second position "not able to cut the file in column basis.
thanks
vikash