Re: tac replacement



yiyu.jgl@xxxxxxxxx schrieb:

I need to process the end of a file before the beginning. I have seen
some threads where a tac | awk ... | tac solution is proposed, but
there is always the problem of not having tac in your system.

If you have a Unix sort command, then try this:

awk '{print NR, $0}' data_file.txt | sort -n -r | awk '{$1=""; print $0}'
.



Relevant Pages

  • Re: tac (reverse of cat) as pure executable for HP-UX 10.20
    ... instead of "no tac". ... list of different ways to do a reverse cat that I compiled years ago. ... # Most implementations of awk can handle bigger files than sed. ... # Just be aware that most seds will choke on big files using the ...
    (comp.sys.hp.hpux)
  • Re: Sed: How to join lines back
    ... >I have a very large log file with lots of different sorts of lines in ... I'd use tac to reverse the file, then use awk to join the lines, ...
    (comp.unix.questions)
  • Re: Sed: How to join lines back
    ... >I have a very large log file with lots of different sorts of lines in ... I'd use tac to reverse the file, then use awk to join the lines, ...
    (comp.unix.shell)
  • Re: tac replacement
    ... some threads where a tac | awk ... ... If you have a Unix sort command, ...
    (comp.lang.awk)
  • tac replacement
    ... some threads where a tac | awk ... ... gentoo forum, but didn't take note of the url). ...
    (comp.lang.awk)