I have a folder with about 800 text files in it, each with about 30 lines of code, the folder is called “states”. How would I get all of the text files within this folder, and search each of them to find if there are duplicate numbers within them?
I have found this one manually as an example, in one of the text files, the lines are
provinces = {
282 325 3315 3361 6307 6372 6403 9270 9280 9305 9381 9390 9402 11255 11263 11286 11387
}
In a seperate text file, the lines are
provinces={
282 325 3282 3315 3361 6253 6307 6312 6357 6372 6403 9244 9259 9270 9280 9305 9307 9373 9381 9390 9402 11255 11263 11286 11356 11387
}
In both instances, they both use the numbers 282, 325, and 3361 among several others, how would I make a PowerShell script for windows to help me find these instances and print them to a separate text file?
I don’t use PowerShell often so i’m not too adept with it, and I’m not exactly sure if it’s easy to search for duplicate instances in similar lines of code, so I wouldn’t know where to start. Thanks in advance!