Created
April 10, 2014 20:00
-
-
Save ciiqr/10417553 to your computer and use it in GitHub Desktop.
Batch Parse Delimited File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
REM Example | |
REM File must have 4 peices of data, seperated by commas & spaces and individual records on each line | |
REM 4 Peices of data | |
REM , as delimiter | |
REM Read file line by line | |
FOR /F "tokens=1-4 delims=, " %%a in (filename.ext) do ( | |
REM %%a is the first item on the line, %%b is the second, etc. | |
ECHO %%a | |
ECHO %%b | |
ECHO %%b | |
ECHO %%c | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20040110, 12345, Withdraw, 300 | |
20140101, 12345, Deposit, 400 | |
20140108, 22222, Deposit, 200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment