Skip to main content
Solved

How to pass an filename (from excel reader) to systemcaller (python script)?

  • April 17, 2025
  • 1 reply
  • 87 views

norris
Contributor
Forum|alt.badge.img+3

I am fairly new to FME and I am trying to pass an Excel file pathname to systemCaller so I can use it in a Python script. I need to use the SystemCaller as I am using a bat file to change virtual environment and then call Python.

What I am trying to do is get FME to just pass the Excel filename via a user parameter to SystemCaller using this statement

"C:\temp\Excel_processing.bat" --input "$(excel_infil)"

where excel_infil = “C:\temp\Excel_processing\infile.xls”

But I get a “File path is incorrect” error in the logger (not in english, so the error is a translation). I have even tried to just hardcode the input filename to the statement but get the same error. I tried this:

"C:\temp\Excel_processing.bat" --input “C:\temp\Excel_processing\infile.xls”

 

If i just use the statement "C:\temp\Excel_processing.bat" in SystemCaller, then I dont have any issues and the .bat/python script works as expected but I need FME to pass the filename along. 

I have a bunch of echo statements in the .bat file but FME doesnt even run the .bat file, so my statement is incorrect.

Any ideas why my statement is not working?

Best answer by norris

I found my error! turns out I had the wrong varible set in the .bat file. sigh

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

norris
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • Best Answer
  • April 17, 2025

I found my error! turns out I had the wrong varible set in the .bat file. sigh