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
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?
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).
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.