Question: Read multiple content file

Hello,

 

  I have a complicated task. Suppose there is a file, its content is

1

A    3
0.8 0.2

0.6 0.3

0.5 0.4
****
2
A   3

0.8 0.2

0.6 0.3

0.5 0.4

****

 

  I want to read the file for each line, and store the content in each variable, e.g. "S" and 3 for two different variables, respectively. 

By using 

Nn:=readline("file");
Nn2:=readline("file");
Nn3:=readline("file");

parse(Nn);

parse(Nn2);

 

For N2, it does not work "Error, incorrect syntax in parse: unexpected number (near 6-th character of parsed string)"

 

How to read such a file properly including varies of content? Thanks a lot!

 

 

Please Wait...