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

x
?
Solved

Exclude Space as a delimiter

Posted on 2009-04-27
2
Medium Priority
?
514 Views
Last Modified: 2012-05-06
I am trying to use a batch file with a for statement in it.  The input file that I am using has spaces in the fields so I want to exclude the space character as a delimiter.  I have changed the default delimiter but space still seems to be a delimiter.

Input file is something like this
computer,Test Computer,4,16

the resulting variables are
%%a=computer
%%b=Test
%%c=Computer
%%d=4

I want %%b to be Test Computer
making %%c 4 and %%d 16.

What am I doing wrong.  

FOR /F "eol=; tokens=1,2,3,4 delims=," %%a in (internal.csv) do 
 
upwork.bat %%a %%b %%c %%d

Open in new window

0
Comment
Question by:willettmeister
2 Comments
 
LVL 11

Accepted Solution

by:
willettmeister earned 0 total points
ID: 24243117
nevermind I worked around it
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24243143
Try this..

FOR /F "eol=; tokens=1,2,3,4 delims=," %%a in (internal.csv) do (
   echo a[%%a] b[%%b] c[%%c] d[%%d]
)


when that works, try this....


FOR /F "eol=; tokens=1,2,3,4 delims=," %%a in (internal.csv) do (
   upwork.bat %%a %%b %%c %%d
)

NOTE: Don't for get to include the closing paranthesis.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, I read that Microsoft has analysed statistics for their security intelligence report. It revealed: still, the clear majority of windows users do their daily work as administrator. An administrative account is a burden, security-wise. My ar…
The article covers five tools all IT professionals should know about, as they up productivity by a great deal!
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question