troubleshooting Question

replacing four spaces in a text file

Avatar of Program652
Program652Flag for United States of America asked on
Microsoft DOS
4 Comments1 Solution338 ViewsLast Modified:
I have a text file (output of the dsquery command of several fields) that has a delimiter of four spaces.  I need to change the delimiter to something else (since data in some of the lines contain a single space) so I can import the file into a table.  I have a batch file (see code) that is close, but no cigar.  I cannot get the delims to see *multiple* spaces as a delimiter.  The behavior is to handle *any* number of spaces as one (1).
I have to deal ONLY in BATCH.  
No windows scripting,
No third party utilities.  
Ideas how to do this?
for /f "skip=2 tokens=1-5 delims= " %%i in (filename.txt) do @echo %%i~%%j~%%k~%%l
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros