|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Dear Friends, I have a very little knowledge on shell scripting. I am stuck with a problem for which I need an expert advice. I have a .txt file "image_urls.txt" which contains the data like this Code:
imageurl -------------------------------------------------------------------------------------------- photos.ecarlist.com/Jl/8V/wM/lf/rR/vh/Vr/b0/EE/5C/dQ_640.jpg|KMHDC8AEXBU087303_1.jpg| photos.ecarlist.com/Ow/MN/M7/qn/oD/zo/hJ/nw/m9/WF/PA_640.jpg|KMHDC8AEXBU087303_2.jpg| photos.ecarlist.com/4d/HO/73/Jb/61/pE/Ru/uL/JB/Nb/gQ_640.jpg|KMHDC8AEXBU087303_3.jpg| photos.ecarlist.com/7K/ve/VF/XQ/fn/Bn/SX/9R/T2/nj/eA_640.jpg|KMHDC8AEXBU087303_4.jpg| photos.ecarlist.com/vp/Ig/sz/IH/T6/BF/EP/U3/0x/wB/zQ_640.jpg|KNADE223296557487_1.jpg| photos.ecarlist.com/n2/2d/mZ/ex/dx/nG/Bd/z2/hW/Bm/8g_640.jpg|KNADE223296557487_2.jpg| photos.ecarlist.com/JU/Ga/X0/io/ik/sr/uL/ku/z3/kB/ag_640.jpg|KNADE223296557487_3.jpg| photos.ecarlist.com/ba/1o/jo/Jb/aN/8Y/z5/IX/q1/rG/lQ_640.jpg|KNADE223296557487_4.jpg| (h t t p urls above) Since the images names are not unique they are getting overwritten as soon as its downloaded. So I want to rename the images in first column with the second column value (vin_series) in a loop (line by line), one by one image. The renamed images will be there in the directory and mapped in the database. Please help me on this. Regards Praveen Last edited by Scrutinizer; 01-21-2013 at 04:34 AM.. Reason: code tags |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Use
--output-document option with
wget to specify the file name while downloading: Code:
while IFS="|" read url img skip
do
[[ ! -z "$img" ]] && wget --output-document="${img}" "${url}"
done < image.urls.txt |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thanks lot for help !!
Thanks lot for help !!
|
| Sponsored Links | ||
|
![]() |
| Tags |
| download images and rename |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Rename a header column by adding another column entry to the header column name | Vavad | UNIX for Dummies Questions & Answers | 1 | 08-06-2011 01:02 PM |
| Rename a header column by adding another column entry to the header column name URGENT!! | Vavad | Shell Programming and Scripting | 4 | 08-05-2011 12:35 PM |
| loop in awk - column max for each column | irrevocabile | Shell Programming and Scripting | 3 | 03-12-2011 04:54 PM |
| Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2 | rydz00 | Shell Programming and Scripting | 7 | 11-09-2010 10:28 AM |
| Changing one column of delimited file column to fixed width column | manneni prakash | Shell Programming and Scripting | 5 | 06-22-2009 05:27 AM |
|
|