Microsoft
Software
Hardware
Network
Question : A tiny Bash Script to sort and show
Hi:
Consider I have a text file as this one in attached, and I need a tiny Bash script to just sort it by its first field (the numeric field) and display it in the screen. Questions:
1) Is it possible to sort it in descending order? (just in case)
2) Is it possible to sort it by the first field and then by the second field? (just in case too)
Thanks.
Mario./
Answer : A tiny Bash Script to sort and show
cat filex.txt | sort -nr
will do the job
-n is for numeric sort and -r is for descending order
if u want to sort by the second field try
cat filex.txt | sort -k2
hope this is what you mean
Random Solutions
My timer control is gone
CONNECTIVITY ISSUES WITH SQL SERVER EXPRESS 2008, WINDOWS SERVER 2003 AND XP
Want to create a transparent image over a photo for web page..
IIS SMTP - "Relaying denied. Proper authentication required."
Forward Lookup Zone Help
While running cgi/perl scripts the file is opening for download not executing the perl/cgi script
OSCommerce META tags
Connect Exchange 2003 to Gmail
DNS Issues with Active Directory
Understanding sp_lock