Input looks like this. The fields from left to right are:
Place,Name,Rider Number,Team name,Points
Code: Select all
1 Peter Schmitt (1133) Brown Cty Comp 1350
2 Michael Gierlach (1108) Independent 1311
3 Johnathan Van Lanen (1134) West Bend HS 1267
4 Richard Bailey (1100) Forestville Combined 1188
5 Tyler Johnson Schneider (1111) Sun Prairie Comp 900
Need the output to be
Code: Select all
1,Peter Schmitt,1133,Brown Cty Comp,1350
2,Michael Gierlach,1108,Independent,1311
3,Johnathan Van Lanen,1134,West Bend HS,1267
4,Richard Bailey,1100,Forestville,Combined,1188
5,Tyler Johnson Schneider,1111,Sun Prairie Comp,900
Now it is easy enough to split out the Place, Name and rider number using two for loops.
Code: Select all
@echo off
FOR /F "TOKENS=1-3 delims=()" %%G IN (overall.txt) DO (
FOR /F "TOKENS=1* delims= " %%J IN ("%%~G") DO (
>>Overall.csv ECHO %%J,%%K,%%H,%%I
)
)
But that leaves me with this.
Code: Select all
1,Peter Schmitt ,1133, Brown Cty Comp 1350
2,Michael Gierlach ,1108, Independent 1311
3,Johnathan Van Lanen ,1134, West Bend HS 1267
4,Richard Bailey ,1100, Forestville Combined 1188
5,Tyler Johnson Schneider ,1111, Sun Prairie Comp 900
I still need to get the Team Name separated from the riders total points. And there is a trailing space after the name and a trailing space before the Team Name. I think I am finally going to be forced to use REPL.