Hi,
I am running PowerSwitch 10 on Mac OS 10.6.
I try to run a python script with the "execute command" tool to convert csv files to xml.
the python script looks like that:
#! /usr/bin/env python
import sys
import csv
csv.register_dialect('custom',
delimiter=',',
doublequote=True,
escapechar=None,
quotechar='"',
quoting=csv.QUOTE_MINIMAL,
skipinitialspace=False)
with open(sys.argv[1]) as ifile:
data = csv.reader(ifile, dialect='custom')
print ""
for record in data:
print " "
for i, field in enumerate(record):
print " " % i + field + "" % i
print " "
print ""
The script itself works fine if run "manually" in the terminal application.
I now want switch to run the script..
I configured the "execute command" flow element with these properties:
command or path: /bin/bash
arguments: python Volumes/HD/Desktop/csv2xml.py "%1" > "%2"
Output: file at path
Output extension: XML (*.xml)
But i never got any file written into my output folder. The message given by the "execute command" is that: "File '_00023_input.csv' was sent to null; it will be deleted when the entry point finishes"
Can somebody please tell me what i am doing wrong here?
execute command to launch a python csv to xml script
-
dkelly
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
Hello, I've written a 100% Switch Javascript CSV->XML conversion if you are interested.
Dwight Kelly
Apago, Inc.
dkelly@apago.com
Dwight Kelly
Apago, Inc.
dkelly@apago.com
Hello, I've written a 100% Switch Javascript CSV->XML conversion if you are interested.
This would be an even better solution. It would be great if you can share it with me!
Can you try changing the arguments to: -c 'python Volumes/HD/Desktop/csv2xml.py "%1" > "%2"'
I tried that, but sadly it didn't change anything.
This would be an even better solution. It would be great if you can share it with me!
Can you try changing the arguments to: -c 'python Volumes/HD/Desktop/csv2xml.py "%1" > "%2"'
I tried that, but sadly it didn't change anything.
-
fcanneviere
- Newbie
- Posts: 1
- Joined: Tue Aug 02, 2011 9:49 am
hello,
excuse me for my poor english because i'm french.
I have a full flow in python.
that's work very well
Try to use the absolut path for python
excuse me for my poor english because i'm french.
I have a full flow in python.
that's work very well
Try to use the absolut path for python