Simple answer :

perl -ple '$_.= " " x (500-length($_))' file1>file2

thanks to perl

But be carefull on line greater than 500 characters !

Publicités