Spaces in Path(s) Throwing Errors

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bashibashouks
    New User
    • Feb 2011
    • 2

    Spaces in Path(s) Throwing Errors

    I have the following script:
    Code:
    file-report layout:side-by-side options:display-mismatches,line-numbers &
    title:%3 &
    output-to:%4 &
    output-options:wrap-word,html-color %1 %2
    I execute this code using the command below:
    Code:
    "C:\Program Files\Beyond Compare 3\BCompare.exe" "@C:\SQL Queries\BC_AutoScript_02012011.txt" C:\BCompare\File1.csv C:\BCompare\File2.csv WHAT_A_SURPRISE "C:\SQL Queries\Report.html"
    However, I get an error. The log is below:
    2/1/2011 2:52:41 PM >> #log verbose "C:\SQL Queries\Log_Test.txt"
    2/1/2011 2:52:41 PM >> file-report layout:side-by-side options:display-mismatches,line-numbers &
    2/1/2011 2:52:41 PM >> title:WHAT_A_SURPRISE &
    2/1/2011 2:52:41 PM >> output-to:C:\SQL Queries\Report.html &
    2/1/2011 2:52:41 PM >> output-options:wrap-word,html-color &
    2/1/2011 2:52:41 PM >> C:\BCompare\File1.csv C:\BCompare\File2.csv
    2/1/2011 2:52:41 PM Fatal Scripting Error: Unexpected argument(s) "Queries\Report.html"
    2/1/2011 2:52:42 PM Script completed in 1.53 seconds
    If I point the output destination to C:\SQL_Queries\Report.html, it works. So, how do I escape the space when passing the path in as a command line argument?

    Thanks

    Bashibashouks
  • Aaron
    Team Scooter
    • Oct 2007
    • 15997

    #2
    Hello,

    You will need to place quotes around your %4 variable in your script:
    output-to:"%4" &

    to handle the whitespace in the filepath. How does that work for you?
    Aaron P Scooter Software

    Comment

    • bashibashouks
      New User
      • Feb 2011
      • 2

      #3
      That works most excellently. Thanks much.

      Comment

      • Divya Dharani
        Visitor
        • Aug 2018
        • 4

        #4
        Originally posted by Aaron
        Hello,

        You will need to place quotes around your %4 variable in your script:
        output-to:"%4" &

        to handle the whitespace in the filepath. How does that work for you?
        8/10/2018 12:03:39 PM >> file-report layout:side-by-side &
        8/10/2018 12:03:39 PM >> options:ignore-unimportant &
        8/10/2018 12:03:39 PM >> title:"Comparison Report" &
        8/10/2018 12:03:39 PM >> output-to:"C:\Users\user_name\Documents\Visual Studio 2015\Projects\folder\filename.html" output-options:html-custom="C:\Users\user_name\Documents\Visual Studio 2015\Projects\folder\MyStyle.css" "C:\Users\user_name\Documents\file1.txt" "C:\Users\user_name\Documents\file2.txt"
        8/10/2018 12:03:40 PM Fatal Scripting Error: Unexpected argument(s) "Studio"
        8/10/2018 12:03:42 PM Script completed in 2.22 seconds

        Even after I use quotes, it's not working for me.. please help

        Comment

        • Aaron
          Team Scooter
          • Oct 2007
          • 15997

          #5
          Thanks. I've repeated this issue and it appears that quotes are not handled for the html-custom option in the current release. I'll open a tracker entry to investigate. In the meantime, place your .css file in a folder path with no spaces, and it should then work.
          Aaron P Scooter Software

          Comment

          • Divya Dharani
            Visitor
            • Aug 2018
            • 4

            #6
            Thank you so much

            Comment

            Working...