Padding in Unix

I have a file with different character counts on each line
how do i make it with unique character counts.

example:

1st line : ABCD 011 XYZ 0000 YYYY BBB TEADINGDA
2nd line: ABCD 011 xys 0010 YYYY BBB TEAD
3rd line : ABCD 022 YXU 000 UUU BBB TE

1st line is 43 characters
2nd line is 39 characters
3rd line is 37 characters

how do i make all line to be 41 characters

Thanks

I think we need more information.
For example, you could pad the lines with spaces at the end or the front.
Another choice is to expand the column width for each column to some max size, padding each column to that size.

What result do you need?
This pads spaces at the end:

awk '{ printf("%-41s", $0) }' filename > tmpfile
mv tmpfile filename
fmt -w 41 file

Above two suggestions are good and solve the question specifically, but if you need a variation with your end-of-line characters (like a zero or other strings), then this is conceptually simple and modifiable

cat filename | sed -e 's/$/random chars spaces numbers etc/' | cut -c1-41

Replace "random chars spaces numbers etc" with spaces/phrases/etc