in reply to compare two files to get a match
Try to translate into Perl a simple manual procedure, this normally works.
Me and others monks are happy to (try to) help you but is better to help you to code better than offer you solutions you may not understand.
try my first suggestion and post some code.
In addition i see that third column of mapped.txt is NC_002755.2 (counting from zero) or ref counting from 1: how can this lie between 1..1524 ? You want to compare every line of first file against every line of the second one?
L*
|
|---|