Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

randomize order of lines

Status
Not open for further replies.

goop5

Vendor
Jul 14, 2003
1
BE
Does someone have an AWK-script to randomize the order of lines in a file?
 
something like that [courtesy of comp.lang.awk]:

nawk 'BEGIN{srand()}{print rand(), $0}' myFile.txt | sort | cut -d' ' -f2-

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top