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
Access 2007 accdb form - Close Form button event causes #Deleted in fields, yet record is NOT deleted
SATA using XFS (debian)
Need help with a batch loop
Find and Copy string from text file in Korn Shell script KSH
rownum
Strip spaces out of phone numbers in Excel
How to make large files available for downloading?
HELP!!! - "550 5.7.1 Unable to relay for" problem
Search not returning results
TCP/IP stack bad on SBS 2003 box?