I need some help in creating separate CSV files based on the contents of a directory.
The CSV would contain the designated substring as one column, and the complete path and filename in a second column. No quotes as text qualifiers.
Assume the folder name = C:\Temp\Images
The content is as follows:
123456_A.tif
123456_B.tif
123456_C.tif
123456_D.tif
.....
234567_A.tif
234567_B.tif
.....
345678_A.tif
345678_B.tif
345678_C.tif
I need to end up with three (3) separate CSV files, based on a substring of the filename. (In this case, the first 6 characters.)
Example;
"123456.csv" would contain
123456,C:\Temp\Images\123456_A.tif
123456,C:\Temp\Images\123456_B.tif
123456,C:\Temp\Images\123456_C.tif
123456,C:\Temp\Images\123456_D.tif
"234567.csv" would contain
234567,C:\Temp\Images\234567_A.tif
234567,C:\Temp\Images\234567_B.tif
"345678.csv" would contain
345678,C:\Temp\Images\345678_A.tif
345678,C:\Temp\Images\345678_B.tif
345678,C:\Temp\Images\345678_C.tif
I've used Powershell before, but this specific task is over my head. If someone would be kind enough to get me started, I can probably refine it and get it working as required.
Any assistance would be greatly appreciated. Thanks!
The CSV would contain the designated substring as one column, and the complete path and filename in a second column. No quotes as text qualifiers.
Assume the folder name = C:\Temp\Images
The content is as follows:
123456_A.tif
123456_B.tif
123456_C.tif
123456_D.tif
.....
234567_A.tif
234567_B.tif
.....
345678_A.tif
345678_B.tif
345678_C.tif
I need to end up with three (3) separate CSV files, based on a substring of the filename. (In this case, the first 6 characters.)
Example;
"123456.csv" would contain
123456,C:\Temp\Images\123456_A.tif
123456,C:\Temp\Images\123456_B.tif
123456,C:\Temp\Images\123456_C.tif
123456,C:\Temp\Images\123456_D.tif
"234567.csv" would contain
234567,C:\Temp\Images\234567_A.tif
234567,C:\Temp\Images\234567_B.tif
"345678.csv" would contain
345678,C:\Temp\Images\345678_A.tif
345678,C:\Temp\Images\345678_B.tif
345678,C:\Temp\Images\345678_C.tif
I've used Powershell before, but this specific task is over my head. If someone would be kind enough to get me started, I can probably refine it and get it working as required.
Any assistance would be greatly appreciated. Thanks!