question

Johnson Hu avatar image
0 Likes"
Johnson Hu asked Ben Wilson edited

How can I read complete txt file in flexsim?

I have tried to use fileopen() and filereadline() to read data in a txt file. But it can only read first line and makes me confused. Is there any way to read complete data in txt file?

Thank you so much for your help!

FlexSim 18.0.8
data importreadtext file
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

Joerg Vogel avatar image
2 Likes"
Joerg Vogel answered Johnson Hu commented

Text data was read or written in the past line by line. This hasn't changed. You read the first line with filereadline(), the second text line with a second filereadline() and you read the complete text file line by line each line with the filereadline command until you find endoffile().

Read strings separated with a semi-colon contains an example to read a complete text file to identify string parts and print them to the output console. What you actually need is repeat filereadline() until you get to endoffile().

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

Johnson Hu avatar image Johnson Hu commented ·

Ťhanks!It really helps me a lot!

0 Likes 0 ·