question

Manuel Sinco avatar image
0 Likes"
Manuel Sinco asked Manuel Sinco commented

How can I create txt file if it does not exist?

I want to export some data to a .txt file but first I need to check if it exists with command fileexists. If it doesn't, I want to create the .txt file automatically and then fill it out with the data.

Thanks.

Manuel.

FlexSim 19.1.0
commandsexportexisttxt
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Manuel Sinco commented

If you use the command fileopen(fileName, "w"), and the path is valid, then the file will be created, even if it doesn't exist.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Manuel Sinco avatar image Manuel Sinco commented ·

Thanks @jordan.johnson, it worked perfectly.

0 Likes 0 ·