lundi 16 décembre 2019

get from textfile line line and split them

i have a text file file is person.txt, i want to read line, line and keep from each specific variable. the text is as follows

 (person
   (name "Jony")
   (Surname "Black")
   (Other )
   (DATE "Thu Nov  3 17:29:33 2016")
   (INSTANCE  people
      (NET 
         (cal (A 4000232000) (B 4000233000) (G 0) (H 0) (I 0) (C 4000232))
         (ree (A 8000065000) (B 400000) (G 0) (H 0) (I 0) (C 2))
         (op1\[0\] (A 4000061000) (B 4000404000) (G 0) (H 0) (I 0) (C 1000248))
     and so on 

I want to get the name surname, Date, instance, and A,B,G,H,I,C.

I try with getline(input_file, name, '(') but is not a good idea. the patern of () it is difficult for me. If can anyone help me to understand how to split every line and get the values i need. Thanks

Aucun commentaire:

Enregistrer un commentaire