In txt1
S01A1P2
S01A1P5
S01A1P4
In txt2
data/train/wave/S01A1P3.mfc
data/train/wave/S01A1P7.mfc
data/train/wave/S01A1P8.mfc
data/train/wave/S01A1P1.mfc
data/train/wave/S01A1P5.mfc
data/train/wave/S01A1P6.mfc
data/train/wave/S01A1P2.mfc
data/train/wave/S01A1P4.mfc
Use grep -f txt1 txt2
and result
data/train/wave/S01A1P4.mfc
But I want this result that find all pattern
data/train/wave/S01A1P5.mfc
data/train/wave/S01A1P2.mfc
data/train/wave/S01A1P4.mfc
What can I do?
Works for me too.
But you can also try to do it the ugly way-
txt1 contains CRLF line terminators. Try this: