in reply to Using output again without printing

You can always divide the code into two and connect them with a pipe. In this case, I would recommend to replace the first part with sed.

But, you read the entire file to memory in the second phase. That's not a good idea if the file is really big. Try to find an appropriate record separator or read the file in blocks and check whether the part you've read contains a complete record.

  • Comment on Re: Using output again without printing