S
Sebastian Bassi
Hello,
I have to parse a text file (was excel, but I translated to CSV) like
the one below, and I am not sure how to store it (to manipulate it
later).
Here is an extract of the data:
Name,Allele,RHA280,RHA801,RHA373,RHA377,HA383
TDF1,181,,,,,
,188,,,,,
,190,,,,,
,193,*,*,,,
,None,,,*,*,*
,,,,,,
TDF2,1200,*,*,,,*
,None,,,*,*,
,,,,,,
TDF3,236,,,,,
,240,,,,,
,244,*,,*,,*
,252,*,*,,,
,None,,,,*,
,,,,,,
Should I use lists? Dictionary? Or a combination?
The final goal is to "count" how many stars (*) has any "LINE" (a line
is RHA280 for instance).
RHA280 has 1 star in TDF1 and 1 star in TDF2 and 2 stars in TDF3.
I am lost because I do analize the data "line by line" (for Line in
FILE) so it is hard to count by column.
I have to parse a text file (was excel, but I translated to CSV) like
the one below, and I am not sure how to store it (to manipulate it
later).
Here is an extract of the data:
Name,Allele,RHA280,RHA801,RHA373,RHA377,HA383
TDF1,181,,,,,
,188,,,,,
,190,,,,,
,193,*,*,,,
,None,,,*,*,*
,,,,,,
TDF2,1200,*,*,,,*
,None,,,*,*,
,,,,,,
TDF3,236,,,,,
,240,,,,,
,244,*,,*,,*
,252,*,*,,,
,None,,,,*,
,,,,,,
Should I use lists? Dictionary? Or a combination?
The final goal is to "count" how many stars (*) has any "LINE" (a line
is RHA280 for instance).
RHA280 has 1 star in TDF1 and 1 star in TDF2 and 2 stars in TDF3.
I am lost because I do analize the data "line by line" (for Line in
FILE) so it is hard to count by column.