1 Reply Latest reply on Feb 11, 2019 2:20 PM by Patrick Van Der Hyde

    TabCMD reading in a text file with spaces in the filepath

    richard.lumb

      Hello,

       

      I am having trouble with spaces in a filepath. I have several filepaths that contain spaces, but the only one that causes a problem is the path to a text file that I use to feed in parameters.

      TabCMD truncates the path at the first space then returns an error that it can't find the path.

      I've tried enclosing the path in double quotes but this causes tabCMD to treat the path as a string rather than a filepath.

      I've temporarily fixed this by sticking the text file somewhere else, but this isn't a great solution. Any suggestions welcome!

       

      Here is my code:

       

      tabcmd login -s %server%

      :: Logs into the Tableau server - will prompt for a password. Type it in even though no characters appear.

       

      set "EXPORTLOC=\\my path\This one can have spaces"

      echo EXPORTLOC is %EXPORTLOC%

       

      for /f "tokens=1,2 delims=|" %%a in (D:\data\folder with spaces\parameters_list.txt) do (

      echo Creating PDFs for Param1 %%a and Param2 %%b

       

      tabcmd export "MyWorkbook/1_FrontPage?Param1=%%a&Param2=%%b" --fullpdf -f "%EXPORTLOC%\My_Output_%%a_%%b.pdf"

      )  

      )