d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Some Help With Bash Script
Add Reply New Topic New Poll
Member
Posts: 14,619
Joined: May 24 2008
Gold: 103.00
Warn: 10%
Feb 15 2013 02:08pm
Hi

I don't know if it possible but there is any chance to sort unique using a piece of text. Example
I have tumblr links:
http://25.media.tumblr.com/393e9f295c4cac3af0a4b6d3a64c434d/tumblr_mi9e85iFwA1qavye5o1_500.jpg

http://25.media.tumblr.com/393e9f295c4cac3af0a4b6d3a64c434d/tumblr_mi9e85iFwA1qavye5o1_1280.jpg

I want to delete that with _500 and keep that with _1280. 'sort -u' don't do it. It would be nice if I could sort by this bolded text, delete link with lower number and go on :x

I will appreciate any help.

and sorry for my english.
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Feb 15 2013 02:23pm
Quote (Phrarr @ Feb 15 2013 04:08pm)
Hi

I don't know if it possible but there is any chance to sort unique using a piece of text. Example
I have tumblr links:
http://25.media.tumblr.com/393e9f295c4cac3af0a4b6d3a64c434d/tumblr_mi9e85iFwA1qavye5o1_500.jpg

http://25.media.tumblr.com/393e9f295c4cac3af0a4b6d3a64c434d/tumblr_mi9e85iFwA1qavye5o1_1280.jpg

I want to delete that with _500 and keep that with _1280. 'sort -u' don't do it. It would be nice if I could sort by this bolded text, delete link with lower number and go on :x

I will appreciate any help.

and sorry for my english.


why not grep your list by _1280.jpg and pipe that into a file?

something like

cat list.txt | grep "_1280.jpg" >> new_list.txt
Member
Posts: 14,619
Joined: May 24 2008
Gold: 103.00
Warn: 10%
Feb 15 2013 02:36pm
I have it, I merge hi res photo _1280 list with _500 and try to delete same links but with _500 in the end. But I think I will just download both images and eventually manually delete that with _500.
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Feb 15 2013 03:12pm
Quote (Phrarr @ Feb 15 2013 04:36pm)
I have it, I merge hi res photo _1280 list with _500 and try to delete same links but with _500 in the end. But I think I will just download both images and eventually manually delete that with _500.


oh you have the physical files downloaded.

in that case do something like

mv *_1280.jpg /1280folder/; rm -rf /oldfolder
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll