I am fairly new to Powershell and attempting to write a script to achieve the following:
Text file divided into 13 fields Pipe delimited, line length of 227 alpha,numeric in single line.
Text file Field 2 is search CSV file name, 5th Field is Search criteria in CSV file.
If search in CSV file located/found copy field 1,2 & 3 and append it to text file at the end of line, i.e. after 227.
If search csv file or search criteria is not found continue next line in the text file till the end.
Field-1|-Field 2-----|F-3|F-4|Field 5-|-F-6|F-7|F-8|F-9|…|F13| first line details of file generated records starts from line2
Desired Output in Text file.
Field-13 end at 227|14,4595,26172
Field-13 end at 227|12,1122,311
Hope I’ve done a good enough job of explaining what I am attempting, if not I will explain further. From the flexibility I’ve seen with Powershell I have to believe this is doable, it’s just beyond my experience level at this point. Any help would be greatly appreciated.
Thanks in advance.