Quantcast
Browsing all 26 articles
Browse latest View live

Answer by DG for How can I reverse the order of lines in a file?

Try the following command:grep -n "" myfile.txt | sort -r -n | gawk -F : "{ print $2 }"

View Article


Answer by ephemient for How can I reverse the order of lines in a file?

There's the well-known sed tricks:# reverse order of lines (emulates "tac")# bug/feature in HHsed v1.5 causes blank lines to be deletedsed '1!G;h;$!d' # method 1sed -n '1!G;h;$p' # method...

View Article


Answer by Mihai Limbășan for How can I reverse the order of lines in a file?

Also worth mentioning: tac (the, ahem, reverse of cat). Part of coreutils.Flipping one file into anothertac a.txt > b.txt

View Article

Answer by Jason Cohen for How can I reverse the order of lines in a file?

BSD tail:tail -r myfile.txtReference: FreeBSD, NetBSD, OpenBSD and OS X manual pages.

View Article

How can I reverse the order of lines in a file?

I'd like to reverse the order of lines in a text file (or stdin), preserving the contents of each line.So, i.e., starting with:foobarbazI'd like to end up with bazbarfooIs there a standard UNIX...

View Article


Answer by user956584 for How can I reverse the order of lines in a file?

For Windows:busybox.exe tac a.txt > reva.txt

View Article
Browsing all 26 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>