mnenad
Programmer
- Oct 21, 2011
- 2
I've got a complicated csv file with records in more than one line and i just don't know anymore what to try next. anyway my csv partly looks like this:
GERMANY,,,,,,,,,Konacan ishod
Dan,Cas,Par,,,,,,,1,X,2
pet,20:30,1801,Werder ,,Dortmund,,,,2.8,3.1,2.4
sub,15:30,1802,Bayern ,, Hertha,,,,1.2,4,9,,
GERMANY,,,,,,,,,UKUPNO GOLOVA
Dan,Cas,Par,,,,,,,0-1,0-2,2+
pet,20:30,1801,Werder ,,Dortmund,,,,4.3,2.05,1.2
sub,15:30,1802,Bayern ,, Hertha,,,,5.7,2.75,1.08
GERMANY,,,,,,,,,Ukupno golova I poluvreme
Dan,Cas,Par,,,,,,,1+,2+,3+
pet,20:30,1801,Werder ,,Dortmund,,,,1.3,2.6,6.5
sub,15:30,1802,Bayern ,, Hertha,,,,1.16,1.8,3.3
GERMANY,,,,,,,,,HENDIKEP
Dan,Cas,Par,,,,,,,HEN,H1,HX,H2
pet,20:30,1801,Werder ,,Dortmund,,,,1,1.42,4.63
sub,15:30,1802,Bayern ,, Hertha,,,,-1,1.55,4.2
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
ENGLAND,,,,,,,,,Konacan ishod
as you can see, the record for germany is repeated four times with different headers and values for each pair of team, and that is the same for each country later like england and so on...
i just don't know how to parse this lines into one record for each pair of teams
GERMANY,,,,,,,,,Konacan ishod
Dan,Cas,Par,,,,,,,1,X,2
pet,20:30,1801,Werder ,,Dortmund,,,,2.8,3.1,2.4
sub,15:30,1802,Bayern ,, Hertha,,,,1.2,4,9,,
GERMANY,,,,,,,,,UKUPNO GOLOVA
Dan,Cas,Par,,,,,,,0-1,0-2,2+
pet,20:30,1801,Werder ,,Dortmund,,,,4.3,2.05,1.2
sub,15:30,1802,Bayern ,, Hertha,,,,5.7,2.75,1.08
GERMANY,,,,,,,,,Ukupno golova I poluvreme
Dan,Cas,Par,,,,,,,1+,2+,3+
pet,20:30,1801,Werder ,,Dortmund,,,,1.3,2.6,6.5
sub,15:30,1802,Bayern ,, Hertha,,,,1.16,1.8,3.3
GERMANY,,,,,,,,,HENDIKEP
Dan,Cas,Par,,,,,,,HEN,H1,HX,H2
pet,20:30,1801,Werder ,,Dortmund,,,,1,1.42,4.63
sub,15:30,1802,Bayern ,, Hertha,,,,-1,1.55,4.2
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
ENGLAND,,,,,,,,,Konacan ishod
as you can see, the record for germany is repeated four times with different headers and values for each pair of team, and that is the same for each country later like england and so on...
i just don't know how to parse this lines into one record for each pair of teams