Import .txt and convert to .dat

0
Hello Together, Maybe someone has an idea about that. We have a measuring machine which writes the results into a .txt file. The thousands delimiter of the values are a dot, but for further processing i need a comma. Moreover i need to convert the .txt file into a .dat file.  Is there a way to automate that with Mendix? For example : What i get from the machine: .txt 0.345 0.456 0.789 What i need: .dat 0,345 0,456 0,789 Thank you for your help!
asked
3 answers
0

I would create a specific Java action for it that reads the file and transforms it in the correct format with correct file name.

This way you can make your imput a filedocument and as output the transformed filedocument.

Regards,

Ronald

 

answered
0

If the file content fits in memory, you could use community commons java action StringFromFile to read the file into a string, use replace() functions in a change variable actions, and then write it back a file using the StringToFile action.

answered
0

I will try.

Thank you for your Help!

answered