Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output to file when match is found

Status
Not open for further replies.

ponoodle

IS-IT--Management
Dec 10, 2010
135
US
I am a PowerShell beginner and I need some direction. I have a text file with rows that look like this: 123,456,78,90,12,34,x5,678
I have a CSV file that has rows that look like this: ab,1,234,01/01/2020,56.78,9,01234,5,-678,some words
I want to write each row of the text file to a new file only if the number after the first comma is anywhere in the 7th column of the CSV. These numbers can be anywhere from 1 to 10 digits.

Can this be done in PowerShell? And if so, any suggestions would be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top