Results 1 to 8 of 8

Thread: ~~

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Your very own Pikachu! Banned Peegee's Avatar
    Join Date
    Mar 2001
    Posts
    19,488
    Blog Entries
    81

    Grin Input string with space in dos batch

    I've narrowed it down to this question:

    "In a dos prompt batch input file, how do you input a string that has a space?"

    Eg (simplied to illustrate the point):

    Say you have a file input.txt

    input.txt has the following lines

    "telephone"
    "caterpillar"
    "boeing airplane"

    If you were to run the following batch:

    for /f %%i in (input.txt) do (
    @echo %%i
    )

    You will get the following :

    "telephone"
    "caterpillar"
    "boeing

    Where's the " airplane"?? It doesn't get picked up by echo!

    However if you typed in dos prompt echo "boeing airplane" it would output:

    boeing airplane

    aieee~
    Last edited by Peegee; 06-08-2009 at 06:31 PM. Reason: wtf I thought I wrote the title properly

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •