Page 1 of 1

Execute Command - CSV 2 XML

Posted: Tue May 29, 2012 11:17 am
by JimmyHartington
Hi



I have trouble using the Execute Command.



I have found a free command line tool, which convert a CSV-file to XML.

It can be found here: http://www.jens-goedeke.eu/tools/csv2xml/



I have it installed and chosen in the Execute Command.

The arguements are set to: -s:"%1" -t:"%2" -sep:; -m:1 -enc:UTF-8



This does not work.



I have my logging in PowerSwitch set to debug, and can see the command which PowerSwitch tries to execute. If I copy it from the debug-log and run it in cmd.exe, then it works.



I have also tried to make the arguments to this: -s:"D:csv2xmlfsr-csv-inputInput.csv" -t:"D:csv2xmlfsr-xml-outputInput.xml"

So I have hard-coded the files and where the output should be. Just to see if it would execute. I have of course made sure that there are a file at the input location. If Switch is set to execute this it fails. If I run it from the command-line it works.



Does anybody have a good idea to what to do?



Kind regards

Jimmy Hartington

Execute Command - CSV 2 XML

Posted: Thu Jun 07, 2012 3:30 pm
by JimmyHartington
Hi



I have now solve the problem. Or it is not me.



Enfocus Maintenance helped out. And I have been granted permission to share the solution here, so I hope it can help others.



Here is the file Enfocus Maintenance supplied: http://db.tt/ptuXxuuG



And here is the answer from mail:

It looks like the CLI application does not accept files with spaces in

path from Switch even though it is possible to provide spaces when running

command

Via command line.



We have created a simple workaround - we now call the CLI from within a

custom script.



Please find attached flow and the custom script.



You will have to adjust your path to the CLI application inside the CMD

file as of course also browse to the CMD on your system. Please also

notice the separator, so do not forget to adjust that as well if needed.


So remember to change the path according to your setup, if you should use the files.