Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5028
  • Last Modified:

double quote (") in delims list !!!

I want to parse a file and use the double quote (") as a delimiter...but I cannot
use the line like :

FOR /F  "eol=; tokens=1* delims=""

because the options are already between double quotes and this is causing a syntax error !

How can I manage that ??

Thanks in advance for your help.

1 Solution
I think you can use double quote:
for /F  " eol=; tokens=1* delims="" "
I couldn't get the for statement to accept the double quote. I tried a number of things including escaping it (^") and using double quotes (""). Neither worked, but you might consider this:

@echo off

for /F "delims=" %%f in (test.dat) do (
  set lineinfo=%%f
  call :PROCESS

set lineinfo=

goto EXIT


set test=%lineinfo:"=*%

REM ** Here is where you'd do your processing
for /F "eol=; tokens=1,* delims=*" %%f in ('echo %test%') do echo %%f %%g

set test=


You can transform the double quote to another character. I used an asterick.

Good Luck,
ggzAuthor Commented:
Many thanks Steve, your solution is working :-D

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now