Skip to main content
Solved

Apply Python shutdown script on file before FME Flow Download service

  • September 26, 2024
  • 2 replies
  • 59 views

jbriant
Contributor

Hi,

I’m trying to modify the output file of a workspace using a Python shutdown script before it’s caught by the download service (or after, but before downloading). Is there any way to do that?

The configuration is:

  • workspace creating an output text file (interlis)
  • workspace added to a Flow app with a download service

I’ve tried to use the destination dataset parameter from the writer but without success. The script is :

import fme

dest_dataset = fme.macroValues['DestDataset_Interlis']

with open(dest_dataset, 'r') as file:

filedata = file.read()

filedata = filedata.replace(',', '.')

with open(dest_dataset, 'w') as file:

file.write(filedata)

Or if you have any clue on how to force an Interlis writer to use dots instead of commas as separator without changing the server locale, I’ll take that info as well.

 

FME versions:

  • Flow 2023.1.1.1
  • Form 2023.1.1.1

 

Best regards,

Julien

Best answer by virtualcitymatt

No the solution your asking for, however, it it’s a text file have you considered using FME to just do the replacing (feature writer to temp location, read with text file reader as whole tile, replace and then write out again).

It’s not ideal, obviously having the writer do what you want is preferred. But if you can’t get that to work this is probably what I would do

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.

2 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+47
  • Celebrity
  • Best Answer
  • September 26, 2024

No the solution your asking for, however, it it’s a text file have you considered using FME to just do the replacing (feature writer to temp location, read with text file reader as whole tile, replace and then write out again).

It’s not ideal, obviously having the writer do what you want is preferred. But if you can’t get that to work this is probably what I would do


jbriant
Contributor
  • Author
  • September 9, 2025

Sorry, I disappeared.

Thanks tha’ts probably the best option with what I have at disposal.