And i want it to arrange it like this:Albanië;Albanië;Berat;Hotel;Berati;40,9999;19,99999;Meer;ok;0; Albanië;Albanië;Berat;Hotel;Castle Park;45,769969;19,9999;Meer;ok;0; Albanië;Albanië;Berat;Hotel;Mangalemi;40,709999;19,959999;Meer;ok;0; Andorra;Andorra;El Serrat;Hotel;Subi;43,658607;5,568623;;ok;0; Andorra;Andorra;El Serrat;Hotel;Tristan;42,618507;1,538923;;ok;0; Andorra;Andorra;El Tarter;Hotel;Del;42,580340;1,648919;;ok;0; België;Antwerpen;Antwerpen;Bezienswaardigheid;Boerentoren (Kbc Toren); +51,2000;4,399000;;ok;0; België;Antwerpen;Antwerpen;Bed&Breakfast;Borze;51,2200;4,399000;;ok;0; België;Antwerpen;Antwerpen;Bed&Breakfast;Boulevard ;51,220000;4,399000 +;;ok;0; België;Antwerpen;Antwerpen;Appartement;Britselei 37;51,220000;4,399000 +;;ok;0; Engeland;Groot Londen;Londen;Museum;Tate Britain;51,5200;-0,126236;;ok +;0; Engeland;Groot Londen;Londen;Museum;Tate Modern;51,500200;-0,126236;;o +k;0; Engeland;Groot Londen;Londen;Hotel;Testing;51,500200;-0,126236;;ok;0; Engeland;Groot Londen;Londen;Bezienswaardigheid;Thames (rivier);51,020 +0;-0,126236;;ok;0; Engeland;Groot Londen;Londen;Hotel;The Archery London;51,500200;-0,126 +236;;ok;0; Finland;Finland;Ylläsjärvi;Hotel;Yllasrinne;67,526750;24,275630;;ok;0; Finland;Finland;Ypäjä;Bezienswaardigheid;Loimijoki Golf;0,805300;23,27 +1400;;ok;0 Finland;Finland;Ytteresse;Vakantiepark;Solhaga;0,630700;22,962500;;ok; +0 Finland;Lapland;Hetta;Hotel;Hetan Majatalo;6,34700;23,633800;;ok;0 Frankrijk;Alsace (Elzas);Rouffach;Hotel;Au Relais D'Alsace;7,959680;7, +29970;;ok;0 Frankrijk;Alsace (Elzas);Rouffach;Hotel;Château d Isenbourg;7,959680;7 +,29970;;ok;0 Frankrijk;Alsace (Elzas);Ruederbach;Vakantiehuis;Au Cheval Blanc;47,56 +1440;7,26840;;ok;0 Frankrijk;Alsace (Elzas);Sausheim;Camping;Le fary;4,787300;7,36390;;ok +;0;
These are just a few countries in the file, there are many more but this is the general idea. I split the file with @elements = split(/;/,$infile[$i]); but from there i don't know how to procede exactly. I found these topics where somebody is trying a similar thing but with digits. Where as i'm trying it with letters (the countries). Can someone point me in the right direction? with AWK? These look similar as to what i want to accomplish:OUTFILE: Albanië.csv Albanië;Albanië;Berat;Hotel;Berati;40,9999;19,99999;Meer;ok;0; Albanië;Albanië;Berat;Hotel;Castle Park;45,769969;19,9999;Meer;ok;0; Albanië;Albanië;Berat;Hotel;Mangalemi;40,709999;19,959999;Meer;ok;0; OUTFILE: Andorra.csv Andorra;Andorra;El Serrat;Hotel;Subi;43,658607;5,568623;;ok;0; Andorra;Andorra;El Serrat;Hotel;Tristan;42,618507;1,538923;;ok;0; Andorra;Andorra;El Tarter;Hotel;Del;42,580340;1,648919;;ok;0; OUTFILE: België.csv België;Antwerpen;Antwerpen;Bezienswaardigheid;Boerentoren (Kbc Toren); +51,2000;4,399000;;ok;0; België;Antwerpen;Antwerpen;Bed&Breakfast;Borze;51,2200;4,399000;;ok;0; België;Antwerpen;Antwerpen;Bed&Breakfast;Boulevard ;51,220000;4,399000 +;;ok;0; België;Antwerpen;Antwerpen;Appartement;Britselei 37;51,220000;4,399000 +;;ok;0; OUTFILE: Engeland.csv Engeland;Groot Londen;Londen;Museum;Tate Britain;51,5200;-0,126236;;ok +;0; Engeland;Groot Londen;Londen;Museum;Tate Modern;51,500200;-0,126236;;o +k;0; Engeland;Groot Londen;Londen;Hotel;Testing;51,500200;-0,126236;;ok;0; Engeland;Groot Londen;Londen;Bezienswaardigheid;Thames (rivier);51,020 +0;-0,126236;;ok;0; Engeland;Groot Londen;Londen;Hotel;The Archery London;51,500200;-0,126 +236;;ok;0; OUTFILE: Finland.csv Finland;Finland;Ylläsjärvi;Hotel;Yllasrinne;67,526750;24,275630;;ok;0; Finland;Finland;Ypäjä;Bezienswaardigheid;Loimijoki Golf;0,805300;23,27 +1400;;ok;0 Finland;Finland;Ytteresse;Vakantiepark;Solhaga;0,630700;22,962500;;ok; +0 Finland;Lapland;Hetta;Hotel;Hetan Majatalo;6,34700;23,633800;;ok;0 OUTFILE: Frankrijk.csv Frankrijk;Alsace (Elzas);Rouffach;Hotel;Au Relais D'Alsace;7,959680;7, +29970;;ok;0 Frankrijk;Alsace (Elzas);Rouffach;Hotel;Château d Isenbourg;7,959680;7 +,29970;;ok;0 Frankrijk;Alsace (Elzas);Ruederbach;Vakantiehuis;Au Cheval Blanc;47,56 +1440;7,26840;;ok;0 Frankrijk;Alsace (Elzas);Sausheim;Camping;Le fary;4,787300;7,36390;;ok +;0;
http://www.unix.com/shell-programming-scripting/167923-how-split-data-file-into-separate-files-file-names-depending-upon-columns-value.html
http://www.unix.com/shell-programming-scripting/60351-split-file-into-multiple-files-depending-upon-first-4-digits.html
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |