java - Flat file Comparison Tool -
flatfile1.txt
hdr06112016flatfile txt clm12345 abcdef.... dtl12345 100a00.... dtl12345 200b00.... clm54321 abcdef.... dtl54321 100c00.... dtl54321 200d00....
flatfile2.txt
hdr06112016flatfile txt clm54321 fedcba.... dtl54321 100c00.... dtl54321 200d00.... clm12345 abcdef.... dtl12345 100a00.... dtl12345 200b00....
mapping both file same:
header: field startposition endpos length identifier 1 3 3 date 4 12 8 , on
clm:
field startposition endpos length identifier 1 3 3 key 4 12 8 data 13 19 6 , on
dtl:
field startposition endpos length identifier 1 3 3 key 4 12 8 , on
this sample file , may size upto 500mb , 50 fields. need compare 2 files based on mapping. file format - 1 header , claim data(12345) in 1 line , detail data can more one. these claims can present randomly in other file.its not line line mapping. detail data ordering same in both files.
desired output :
for key 54321 , data(pos 13:19) not same.
would please me in comparing 2 files? feasible in java since file size huge?.
java work fine. don't need have files entirely in memory; can open them both , read both incrementally, comparing go along.
Comments
Post a Comment