Basic ASCII text processing
Hi, I often find I need to process text that has NO line endings. I want to insert these so I can use standard tools such as sed, awk, grep etc.
Typically the data is fixed length records BUT has a corruption, so not so easy. Ideally I want to find a tool that will replace a string with another string in a big file with no record delimiters (without trying to read the current "line"). That's all. There must be a way! |
The GNU sed manual says "GNU sed has no built-in limit on line length; as long as it can malloc() more (virtual) memory, you can feed or construct lines as long as you like."
Also, the cut command can be used with -b to specify locations by the byte offset. I have also used emacs to edit binary files, so it should work interactively. Just be sure to put it in fundamental mode (M-x fundamental-mode) not text mode so it doesn't wrap. |
All times are GMT -5. The time now is 10:30 AM. |