LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Basic ASCII text processing (https://www.linuxquestions.org/questions/linux-software-2/basic-ascii-text-processing-559279/)

alanminor 06-05-2007 06:07 AM

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!

KenJackson 06-05-2007 06:40 AM

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.