I am a bit confused how to read this data and extract the information I want and eventually store into an array/vector etc ( which i will know how to do. I'll present what the text file says below. (Note that somehow everything is on one line on the text file so i can't use a new line strategy)


"AFFX-Bt-actin-3_at" c("NM_174225", "NP_776650")
"AFFX-Bt-actin-5_at" c("NM_174225", "NP_776650","NP_776850")
"AFFX-Bt-actin-M_at" c("NM_174225", "NP_776650")
"AFFX-Bt-ef1a-3_at" c("NM_174535", "NP_776960")

(note for each line a new vector/array I can sort that out once i am able to 'read' text file)
For example looking at the first line I would like to read for instance AFFX-Bt-actin-3_at, NM_174225 and NP_776650. The following steps I think is how to do it.

1. detect " and start copying until " is reached again
(i.e AFFX-Bt-actin-3_at)
2. first data entered in vector, detect c(" and read until ",
(i.e NM_174225)
3. when ", detected read until you meet ", again
(i.e NP_776650)
4. repeat step 3 until you meet ")

From then i will write new information in a new vector once ") detected and the process will repeat

Does anybody have a fair idea what to do?

You've got the idea. Read the line. Find ". Start copying until you see another ". Find next ". Copy again until...

Yeah i get the idea. say if(string_name == "\""), how do i start to copy from there and then end copy at next ' " ' for example

Try something. If it doesn't work, tell us what it did wrong and we can help you fix it.

We aren't here to do it for you -- you don't learn that way.

This article has been dead for over six months. Start a new discussion instead.