Licensing...
Shell (sed+awk) solution by Alessandro Improta