Skip to content

Instantly share code, notes, and snippets.

@ciiqr
Created April 10, 2014 20:00
Show Gist options
  • Save ciiqr/10417553 to your computer and use it in GitHub Desktop.
Save ciiqr/10417553 to your computer and use it in GitHub Desktop.
Batch Parse Delimited File
@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
)
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