Hello,
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
Field-1|010010481|F-3|F-4|610209|-F-6|F-7|F-8|F-9|…|F13|
Field-1|044003610|F-3|F-4|051548|-F-6|F-7|F-8|F-9|…|F13|
010010481.csv
14,4595,26172,610201,610202,610203,610204,610205,6 10206,610207,610208,610209,610210,…,
044003610.csv
12,1122,311,051541,051542,051543,051544,051545,051 546,051547,051548,051549,051550
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.