|All -- So I feel I am well versed in scripting....but not to this extent. Here is what I need:|
OUTPUT = RESULTS.CSV file with the header info (HEADER = COL1, COL2, COL3)
FILES = One file type based on the unique name portion of the file but resides in unique dir's for each given site code.
\\SERVER\SITECODE1\UNIQUEFILETYPE\[multiple file names] "CCYYMMDD.SITE.FILETYPE.TXT" (so the CCYYMMDD is the date of the file creation and makes the file unique)
I then need to search for all SITECODEX's with the same
\\SERVER\SITECODE1\UNIQUEFILETYPE\[multiple file names]
\\SERVER\SITECODE2\UNIQUEFILETYPE\[multiple file names]
\\SERVER\SITECODE3\UNIQUEFILETYPE\[multiple file names]
Then once the FOR loop finds all of the files I need to look in the file and pull the following column information for EACH row. Every row is delimited the same with "|" (pipes) and the fields are all the same.
Then I need to pull specific fields into the created RESULTS.CSV
i.e. FIELD1, FIELD3, FIELD6
Soooo...I know I can use the following commands:
A) FOR /f "tokens=1-4 delims=\" %%a in ('dir /b/s/ad') DO () ---- which can pull back all the directories for me to parse IF statements through it
B) Then I thought I could use this.... FOR /F "tokens=21 delims=*" %%a IN ('findstr "XXX" %%a.%%b') --- BUT EVERY field has different results...so I am not sure how to pull back the field without giving the command a FINDSTR....
C) I am unsure how I would write to the CSV from there...soooo
I need help!