I have 21 files that are pipe delimited and contain a header row. Each file contains a Year column. However the Year column could be in a different column for each file. I need to splice out, into new files, all the rows where the Year is 2012. New files need to contain the same header row and be named the same except with a prefix of '52WK_' and only contain the rows from original file where the Year was 2012. Other columns in the files might contain 2012 but it could be Units or other data and not in Years column. Thus important we only get where the Years column is 2012. The remaining rows of data that are not Years of 2012 can be prefixed with 'Non_2012_' and same original filename after that. Attached is my file names to look in and which column is they Years.
Want this in DOS Batch if possible. I have another VB one too as I don't know if client prefers DOS or VB so thought I would do both.