Q:

Reading a file with a batch with n tokens including empty ones

I want to write a batch script which reads each line of a file. Sounds easy but the problem is that not every line has the same amount of tokens. The next thing is that every token is seperated from each other with a delimiter which I don't want to have in my output. 
Here is a example of the file:
string1|string2|string3|string4
string1|||string4

When I'm reading that file, every token has to be on its right place. What I mean is when I'm reading the second line the output must be: 

string1 empty empty string4

thanks for help

A:

Thanks for your answers. 
But I found out that I had another problem. The count of the tokens are not always the same and the count is often about 20-40 tokens at one line. 
I created a solution with a sub-procedure:
@echo off
setlocal enabledelayedexpansion

for /f "tokens=*" %%a in (Book1.csv) DO (
set "work=%%a"
for /l %%i in (1,1,2) do set "work=!work:||=|NULL|!"
set "line=!work!"
call :processToken
)
goto eof

:processToken
for /F "tokens=1* delims=|" %%x in ("!line!") do (
echo %%x
set line=%%y
)
if not "!line!" == "" goto :processToken
goto :eof
:eof

