hi,
Does anyone has any idea in adding few blank spaces at the end of every record in a file.
Eg:
file.txt
Baby Boy Kim 1234 Baby Boy Vik 1334
Desired output:-
output.txt
I want to add 10 blank spaces at the end every record in file.txt
Thx
>gawk '{print $0" ~"}' file.txt Baby Boy Kim 1234 ~ Baby Boy Vik 1334 ~
Note that I put a ~ as the 11th character to make it easier to see what happened. Simply do not use this and you will have 10 spaces at end of each line.
sed -i 's/[ ]*$/ /' file.txt
If the line already have a space at end it will replace it with 10 spaces
sed 's/$/ /' file.txt > output.txt