TAN WhoAMI

TAN WhoAMI

  • NA
  • 291
  • 0

Find Repeat String in a text file

Sep 2 2014 9:38 AM
I have multiple text files (in a certain directory), and in each text file contains many rows of such numbers as such:

40000038245886S143301588
40000038245893S143301590
40000038245892S143301582
40000038245907S143301583
40000038245908S143301584
40000038245923S143301585
40000038245901S143301593
40000038245915S143301595
40000038245900S143301535
40000038245918S143301594
40000038245910S143301537
40000038245899S143301581
40000038245896S143301538
40000038245925S143301514
40000038245917S143301511
40000038245903S143301579
40000038245924S143301508
40000038245916S143301509
40000038245906S143301512
40000038245902S143301576
40000038245895S143301510
40000038245913S143301515
40000038245921S143301513
40000038245894S143301504
40000038245920S143301580
40000038245919S143301577
40000038245909S143301578
40000038245891S143301501
40000038245912S143301499
40000038245911S143301507
40000038245944S143301500
40000038245943S143301498

I need to automate it for each text file, to find if there is a repeat of the first 14 digit (40000038245943), and also if there is a repeat of last 10 digit (e.g S143301498).

How can I write some C# code for such purpose? Is it also possible to automate it such that it search through all the text files in that certain directory?

I need to find out which file contains such repeats, and if there is such repeats in that file, display those repeats.

PS: the finding of repeats is within its text file itself, and not with the other text files.

thanks.

Answers (2)