in reply to Re^3: Bolt on where a match is not found to a print script
in thread Bolt on where a match is not found to a print script

Thank you so much guys.. so the primary function of the code is to search through the text files in the folder and print every line that includes a the exact match to the number (contained within the line). the secondary requirement is that IF after searching through all the files no single match is found of the number then print at the bottom that it was not matched

this is a sample of the data:

Port Name Status Vlan Duplex Speed Fa0/1 Sohnsons connected 1404 full 100 Fa0/2 Sohnsons connected 1404 full 100 Fa0/3 XYZ connected 1221 full 100 Fa0/4 Sohnsons notconnect 1404 full 100

If you searched the files for 3 number (1404,1221,1234) 1234 would not be matched and printed, thus we would want "1234 not matched" printed. The code you presented worked really well for a single search, but we need to search multiple values

Replies are listed 'Best First'.
Re^5: Bolt on where a match is not found to a print script
by hippo (Archbishop) on Dec 05, 2017 at 13:20 UTC

    Thanks for this clarification. In that case, QM's solution should be precisely what you need. Try that and see how you get on.