I need help with comparison of two files and get the positions in third file, both files will have the same fields but the order will be unsorted in 2nd file, third file will give the line number where the data is found.
eg. file1.txt
A
B
C
D
file2.txt
B
D
A
C
outputfileposition.txt
3
1
4
2
Any help appreciated, thanks in advance
This will do the trick :