It took me a while to word this best.Problem 1:Is there a way to find lines in a text file that have the same string at the beginning and the same strings at the end? Beginning and end strings not necessarily equal to each other.Text between the two strings is not consistant in number of characters or number of hyphens.A hyphen is in between notable strings (which I added to my large text file).For example:File:  AAAAA-tjhut-ghyut-FILE1.txt  BBB-fhuj-dnbhg-frt76-FILE2.txt  AAAAA-ghtujukr-hgute7gr-xhyutt-FILE1.txt  AAAAA-VGYT-4d7tt-xhyutt-FILE1.txt  CCCC-fjuk-dryy-fhuj-FILE3.txtLines to detect:  AAAAA-tjhut-ghyut-FILE1.txt  AAAAA-ghtujukr-hgute7gr-xhyutt-FILE1.txt  AAAAA-VGYT-4d7tt-xhyutt-FILE1.txtProblem 2:Is there a way to remove all but one of the lines containing the duplicate strings at the beginning and end from above?Before:  AAAAA-tjhut-ghyut-FILE1.txt  AAAAA-ghtujukr-hgute7gr-xhyutt-FILE1.txt  AAAAA-VGYT-4d7tt-xhyutt-FILE1.txtAfter:  AAAAA-tjhut-ghyut-FILE1.txtBig thanks for any advice.Note: I think using the occurances of the first hyphen and last hyphen can be used to locate the duplicate strings.
Removing lines from text file that contain string at beginning and string at end - and keep one
text processing;text