I am having two files X1 and X2 in linux pc . one file (X1) contains 10000 unique ids (like 1001,5287,6589) Another file (X2)contains lines containing any of these ids in a particular location say in the position 125 to 128 in each line . Now I want to grep lines of the second file (X2) containg ids of the first file (x1) and write it to other file X3. I want any awk command or perl script for this purpose. I want to grep those lines of x2 which have the ids of x1 in the positions 125 to 128 of x2 and not in other positions of x2.I am having two files X1 and X2 in linux pc . o