Arena - Reading Formatted Input from File

  • Follow


Hi,

I am working on a project in Arena. In this I need to read a text file which
has rows starting with a string followed by 5 integers. The string is a flag
and I don't want to read it (i.e. want to skip it). The C format for reading
two rows of such data would be
"%*s\t%d\t%d\t%d\t%d\t%d\n%*s\t%d\t%d\t%d\t%d\t%d". But using this format,
for reading the text (via Read-Write module), is giving errors (says invalid
format). I also tried using %g (and %2.0g) instead of %d but it didn't help
either (Reason for trying %g - one of the example files which come with
Arena uses %g for writing output to a file).

In fact, when reading a text file containing two integers in the first row
(and nothing else) using the C format "%g %g" assigns "5.26354e-315" and
"5.30499e-315" to corresponding variables (they were not initialized).
Though if I use "Free Format" for reading the two integers it works fine.
Also, I can write out to a file using "%g %g".

Awaiting answers/suggestions..
Thanks & bye..
AKS.

0
Reply AKS 11/19/2004 10:22:50 AM


0 Replies
416 Views

(page loaded in 0.016 seconds)

Similiar Articles:













7/27/2012 6:57:15 PM


Reply: