Parse scraped .csv by type of data

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Parse scraped .csv by type of data

This post has NOT been accepted by the mailing list yet.

I scraped a messy .pdf and gathered a data a .csv with " " as only logical separator. But some spaces remain in the first column, which only contains strings (some being interpreted as factors). The rest is only integers (with "," as dec) or dashes.

How could I parse the file properly ?
I tried to make a matrix out of it but my ncol/nrow mix didn't quite work.

Here is an abstract of it :
Cap-Vert 0,0 - - - - 0,0
Centrafricaine (Rép.) 0,0 - - - - 0,0
Congo - 0,6 0,5 0,2 0,7 2,0
Congo (Rép. démocratique du) - - 0,4 0,5 - 0,9
... and so on.

Thank you in advance !

P.S. : first post here, I looked around but didn't find an answer that seemed to match my request. Sorry if I'm flooding with an obvious question : as a good-willed noob, I'm eager to learn !