LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices

Old

bash sort using a tab delimiter

Posted 09-07-2012 at 01:49 PM by NullTerminator
Updated 09-07-2012 at 02:49 PM by NullTerminator
Tags bash, sort, tab

There are several ways to sort things when fields are tab separated. The simplest I have found is
Code:
TAB=`echo -e "\t"`
sort -t"$TAB" -k 5,3 scrambledFile.tsv > sorted.tsv
syntax may vary for dos shells, possibly as
Code:
set tab=echo "\t"
sort -t"%tab%" -k5,3 scrambledFile.tsv > sortedFile.tsv
As of this posting, both variations are subject to verification of the syntax.
LQ Newbie
Posted in Uncategorized
Views 482 Comments 0 NullTerminator is offline
Old

Sorting pictures, removing duplicates

Posted 11-20-2010 at 08:37 AM by jere21
Updated 10-11-2014 at 10:02 AM by jere21

EDIT 2012-02-03/2014-10-11:
In Debian I just discovered "duff". A tool to find duplicate files-.-
Unfortunately it doesn't work with symbolic links to files.
---



All files with their md5sum
Code:
PICS="pics"
find . -type f -exec md5sum '{}' ';' > $PICS
Lists with only md5sum, once with duplicates removed (should be improved to handle double spaces in filenames).
Code:
cat $PICS | sed -r "s|^(.*)
...
LQ Newbie
Posted in Uncategorized
Views 3681 Comments 2 jere21 is offline

  



All times are GMT -5. The time now is 06:45 AM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration