Here's a way to compare two files that have common lines in both files:
sort file1.txt > file1_sorted.txt
sort file2.txt > file2_sorted.txt
comm -12 file1_sorted.txt file2_sorted.txt
Note: files need to be sorted first prior to comparing.
sortcomparing files line by lineSubmitted by sandip on Thu, 03/26/2009 - 22:48Here's a way to compare two files that have common lines in both files: sort file1.txt > file1_sorted.txt Note: files need to be sorted first prior to comparing. »
Sorting VARCHAR data in mysqlSubmitted by sandip on Thu, 01/26/2006 - 11:10Here's a quick tip at sorting VARCHAR type data in mysql database with values in a column. With the default sort, it would look something like below: mysql> SELECT column FROM table_name ORDER BY column; column ====== 100 1000 10000 200 2000 20000 ... Now with "... ORDER BY column+0", I get it sorted right: mysql> SELECT column FROM table_name ORDER BY column+0; column ====== 100 200 1000 2000 10000 20000 ... This is a quick fix instead of sorting to CAST operator. |
User loginRecent blog posts
Who's onlineThere are currently 0 users and 4 guests online.
|