add character to every end-of line in file

Hi All
I have a file which conatins record.the length of every records is 47.
problem : in the end of record i don't have a "\015" character.
i want to add this "\015" charcter in the end of every record.
the file contains something like 700 records.
i've tried with sed command - nothing.

can someone help me how i should do it ?
thanks in advanced

Something like this?

awk '{print $0 "\015"}' file > newfile

Hi
i've tried , still doesn't help for what i want .

If you have no carriage returns on the end of each record how are they delimited? Are you saying the file is one long string with each 47 bytes representing one record?

Hi
unfortunately indeed this is the situation , there is nothing delimiting between the records.

Assuming this is a file containing no record delimiters whatsoever and that all output records will be exactly 47 bytes.

I believe that the record will be too long for "awk" (not checked). We can use the "dd" command to break the long string into 47-byte chunks.
Input block size (ibs=) chosen is deliberately larger than 700 "records" times 47 bytes (32,900 bytes).

dd if=inputfile.txt of=outputfile.txt ibs=131072 cbs=47 conv=unblock

At this point outputfile.txt has 47-byte records each terminated with the unix standard text file line terminator (line-feed).

In the unlikely event that you really do need to convert the line-feed characters (octal 012) to carriage-return characters (octal 015).

cat outputfile.txt | tr '\n' '\r' > outputfile2.txt

Maybe you can give this a try:

awk '{i=1;while(i <= length){print substr($0,i,47);i+=47}}' file 

Use nawk or /usr/xpg4/bin/awk on Solaris if you get errors.

Hi ALl
Thanks for all the replies.
Eventually i did Methyl suggestion,
dd if=inputfile.txt of=outputfile.txt ibs=131072 cbs=47 conv=unblock
and it added delimiter character "/015" in the end of every record .
so the length of every record now is 48 include the "/015" character.
exactly what i wanted.
i did this :cat outputfile.txt | tr '\n' '\r' > outputfile2.txt
but i didn't see any changes.
thank you very much to all of you.
Best regards.

Try this:

tr -d '\r' < dosfile > unixfile