Split field with awk

Hi there I have a text file with several fields separated by ";" as follow :

5466-43;5466;JOAN;LIGA;LIGA ESPANOLA;43;DEP LA CORUNA - OSASUNA;10/01/10 17:00
5466-44;5466;CARLES;LIGA;LIGA ESPANOLA;44;MALAGA - ATHL BILBAO;10/01/10 17:00
5466-45;5466;FAB;LIGA;LIGA ESPANOLA;45;REAL MADRID - MAIORCA;10/01/10 19:00
5466-46;5466;MARCEL;LIGA;LIGA ESPANOLA;46;TENERIFE - BARCELLONA;10/01/10 21:00

What I need to do is to split last column in two parts adjusting the data format into dd/mm/yyyy so that I should have :

466-43;5466;JOAN;LIGA;LIGA ESPANOLA;43;DEP LA CORUNA - OSASUNA;10/01/2010;17:00
5466-44;5466;CARLES;LIGA;LIGA ESPANOLA;44;MALAGA - ATHL BILBAO;10/01/2010;17:00
5466-45;5466;FAB;LIGA;LIGA ESPANOLA;45;REAL MADRID - MAIORCA;10/01/2010;19:00
5466-46;5466;MARCEL;LIGA;LIGA ESPANOLA;46;TENERIFE - BARCELLONA;10/01/2010;21:00

Than I need to save the above result in a new file.
I have tried with something with awk but no way to have the result as I wish.
Thank you in advance for your help
Greetings

Check if this helps

 awk -F ';' '{
for(i=1;i<=NF;i++){
if (i==NF){ sub (" ",";",$NF); print $NF"\n";}
else { ORS=";" ;print $i ; }
ORS="";
}}' abc.txt > file1

The output is sent to file1

And if you want to try perl use this

cat abc.txt  | perl -e 'while(<>){
chomp;
my @cols = split(";");
 $cols[-1]=~ s/ /;/; 
print join(";",@cols)."\n";
}'

HTH,
PL

awk -F\; '{split($NF,a," ");split(a[1],b,_);$NF=b[1]_ b[2]_ "20" b[3] OFS a[2]}1' _="/" OFS=\; file
sed 's|\(..\) \(..:..\)$|20\1;\2|' infile

The first time, my code is shorter than dan's.:smiley:

awk -F\; 'split($NF,a,"[/ ]") {$NF=a[1]"/"a[2]"/20"a[3]";"a[4]}1' OFS=\; file