question

anon-user avatar image
0 Likes"
anon-user asked Arun Kr commented

Customize The Exported CSV File Name Using Export Table Command

Hi Support,

I tried exporting a global table to a CSV file using the export table command. We could export it successfully with a static name to the file. But when I tried to give a dynamic name using the name and date. the export is not working. Kindly help us with this.

Table Summary=Table("TableName");
string Name ="ModelData";
exporttable(Summary,Name,1,1); //This is Working and CSV file is getting created.

But when I tried the following script

Table Summary=Table("TableName");
string Name ="ModelData" + Model.dateTime.toString();
exporttable(Summary,Name,1,1); //This is not Working

The CSV file is not getting created. How can I resolve this?

Regards,

Brijesh Kumar

FlexSim 22.1.2
exporttable
· 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.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·
Does the format contain any illegal characters for filenames? Can you manually rename the file to the expected string?
1 Like 1 ·

1 Answer

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Arun Kr commented

Does it work with a much simpler number depended string like a counter in your name. Perhaps the datetime string composed Format contains characters that are not allowed in a file name like “:”.

anonymous user !

· 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.

Arun Kr avatar image Arun Kr commented ·

Hi anonymous user ,

Try this.

Table Summary=Table("TableName");
int Day = Model.dateTime.day;
string Days = string.fromNum(Day,0);
int Month = Model.dateTime.month;
string Months = string.fromNum(Month,0);
int year = Model.dateTime.year;
string Years = string.fromNum(year,0);
string Name ="ModelData" + Days+"-"+Months+"-"+Years;

Regards,

Arun KR

0 Likes 0 ·