10

Filling file with 10 zeros

view full story
linux-howto

http://www.unix.com – I am stuck with a problem. I have some 100 files with extension .txt. The files look like this: Code: 0 3 0 0 4 All files have variable number of characters and some files are completely EMPTY. I want to make columns of length 10 by putting zeros (0) after the numbers end and also 10 zeros in the completely empty files. The output should look like: Code: 0 3 0 0 4 0 0 0 0 0 The above file has 10 lines after appending 5 0's to the end of file. An empty file should look like: Code: 0 0 0 0 0 0 0 0 0 0 What I am doing now is: Cod (HowTos)