Skip to main content

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.macroValuesV'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

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


Reply