1.

Solve : Bat file FOR statement referencing file-set with embedded blanks.?

Answer»

How do I use the MS-DOS FOR COMMAND to parse a file whose name contains a blank?

Ordinarily, I'd surround the name with quotation marks, but this is interpreted as a string to be parsed, rather than a filename.

Thanks in advance.This is one way:

Code: [Select]echo off
for /f "usebackq delims=" %%a in ("c:\folder\filename and space.txt") do echo %%a
Quote from: John_L. on October 10, 2016, 10:51:51 AM

How do I use the MS-DOS FOR command to parse a file whose name contains a blank?
Hi John,
In this thread and your previous thread you mentioned you are using DOS. Be advised that cmd.exe is not DOS if you are using a variant of Windows NT (2000,XP,Vista,7,8,10).  If you really NEED help with a specific command in regards to DOS then you need to specify what version of DOS you are using. Quote from: Squashman on October 11, 2016, 07:29:50 AM
you are using a variant of Windows NT (2000,XP,Vista,7,8,10)

You nailed it there Squashman.  No version of MSDOS can parse the contents of a file using the FOR command.

The only way a filename can have a space in MSDOS is by using a disk editor and shoving one in that way.   

I believe I'll have another glass of medicine.   Jack Daniels is medicine, right??  No?  What about Johnny Walker??    The DOS FOR command has a lot of FEATURES that are not bedded in a simple loop.
One can create a simple loop that calls another BAT file taught will compare contents of a file. A list of file scan be made with
Code: [Select]DIR /B >LIST.TXTNo FOR loop  needed.

Some of the work will be done manual. But once you have a valid method, you can find some way to make it take parameters are work automatically.

Cant OP give a basic outline of the task? What is the purpose? How much data? What kind input? What would be the output?


Quote from: Geek-9pm on October 11, 2016, 03:32:51 PM
not bedded in a simple loop.

BAT file taught will compare contents of a file.

A list of file scan

It seems that your speech-to-text converter needs a grease and oil change, geek. 




It seems pretty clear that the op was abducted by aliens.  This is becoming a serious problem.
 The problem has been duly noted. Today I received a brand-new microphone and hopefully the dictation will be more accurate in the future.
Also, filenames with blanks can be a problem and makes me wonder why not just not use planks on all and reduce the trouble. A common practice is to use the_in place of a blank . In most cases that should not be a problem.
Well, so far the new microphone is working good. Quote from: Geek-9pm on October 15, 2016, 05:10:21 PM
The problem has been duly noted. Today I received a brand-new microphone and hopefully the dictation will be more accurate in the future.
ahhh, a new tech toy.   I have a liking for new tech toys.

The gain setting will likely have an effect on speech recognition, but of course within the good range and not just high for the sake of high gain.    I've seen that background noise is a particular issue that can make wurds rong, so make sure the cat isn't too noisy when she's playing with the PLASTIC bags. 


Discussion

No Comment Found