5 Replies Latest reply on Feb 1, 2018 9:56 AM by Jon Rector

    Tabcmd Batch File to Loop

    Sanjay Ellanki

      Hi everyone,

       

      I am trying to create a batch file to get pdfs using tabcmd. I can get it to work using manual entry.

       

      tabcmd login <server> -u user --password - c:\Tableaupassword.txt

      tabcmd export "Report/Parameters?ID=test&Start%20Date=2015-03-01&End%20Date=2015-03-31" --fullpdf --no-certcheck

       

      But what i am trying to do is use a variable in batch file from a txt file to input the "ID" filter to generate multiple reports.

      I don't work with CMD at all, but after doing some research was able to generate the values at least from a txt file, but it uses only the last one in the file.

       

      test file has 4 values: test1,test2,test3,test4

       

      FOR /F "tokens=1-6 delims=,"  %i IN (C:\testpdf.csv) DO set var=%1

      tabcmd export "Report/Parameters?ID=%var%&Start%20Date=2015-03-01&End%20Date=2015-03-31" --fullpdf --no-certcheck

       

      This will only get me the last test4 from the batch file. What i want is to generate all 4 pdfs.

       

      I was wondering if anyone has implemented this before or has worked with batch files before and know how does loop works?

       

      thanks,

      Sanjay