Sponsored Content
Top Forums Shell Programming and Scripting Download images from the first column and rename it with the second column in a loop: Please help! Post 302758915 by Praveen Pandit on Monday 21st of January 2013 04:20:00 AM
Old 01-21-2013
Question Download images from the first column and rename it with the second column in a loop: Please help!

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 05:34 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Loop column output

I need help in what to do with a bash script? I'm trying to run a command to output the data from a table and then insert it into commands. Looping for each row of data. For example the output data from a table: 10 John house 20 Jane apt 30 Joe townhomeThen I need to take the output... (1 Reply)
Discussion started by: handband2
1 Replies

2. Shell Programming and Scripting

Changing one column of delimited file column to fixed width column

Hi, Iam new to unix. I have one input file . Input file : ID1~Name1~Place1 ID2~Name2~Place2 ID3~Name3~Place3 I need output such that only first column should change to fixed width column of 15 characters of length. Output File: ID1<<12 spaces>>Name1~Place1 ID2<<12... (5 Replies)
Discussion started by: manneni prakash
5 Replies

3. Shell Programming and Scripting

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2 file 1 sample SNDK 80004C101 AT XLNX 983919101 BB NETL 64118B100 BS AMD 007903107 CC KLAC 482480100 DC TER 880770102 KATS ATHR 04743P108 KATS... (7 Replies)
Discussion started by: rydz00
7 Replies

4. Shell Programming and Scripting

loop in awk - column max for each column

Hello all, this should really be easy for you... I need AWK to print column maxima for each column of such input: Input: 1 2 3 1 2 1 1 3 2 1 1 2 Output should be: 2 2 3 3 This does the sum, but i need max instead: { for(i=1; i<=NF; i++) sum +=$i } END {for(i=1; i in sum;... (3 Replies)
Discussion started by: irrevocabile
3 Replies

5. Shell Programming and Scripting

Rename a header column by adding another column entry to the header column name URGENT!!

Hi All, I have a file example.csv which looks like this GrpID,TargetID,Signal,Avg_Num CSCH74_1_1,2007,61,256 CSCH74_1_1,212007,647,679 CSCH74_1_1,12007,3,32 CSCH74_1_1,207,299,777 I want the output as GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num CSCH74_1_1,2007,61,256... (4 Replies)
Discussion started by: Vavad
4 Replies

6. UNIX for Dummies Questions & Answers

Rename a header column by adding another column entry to the header column name

Hi All, I have a file example.csv which looks like this GrpID,TargetID,Signal,Avg_Num CSCH74_1_1,2007,61,256 CSCH74_1_1,212007,647,679 CSCH74_1_1,12007,3,32 CSCH74_1_1,207,299,777 I want the output as GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num CSCH74_1_1,2007,61,256... (1 Reply)
Discussion started by: Vavad
1 Replies

7. Shell Programming and Scripting

adding one more column in a loop

data1 1 0.01 3 5 1 0.6 2 1 data2 2 0.02 3 5 2 0.3 2 1 data3 3 0.01 3 5 3 0.01 2 1 output 1 0.01 data1 2 0.02 data2 3 0.01 data3 3 0.01 data3 I want to print 1st, 2nd column and the filename when second column is less than 5. (3 Replies)
Discussion started by: johnkim0806
3 Replies

8. Shell Programming and Scripting

Difference of the same column when two other column matches and one column differs less than 1 hour

This is my input file : # cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9 This is the required output ... (1 Reply)
Discussion started by: Lakshmikumari
1 Replies

9. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

10. UNIX for Beginners Questions & Answers

If pattern in column 3 matches pattern in column 2 (any row), print value in column 1

Hi all, I have searched and searched, but I have not found a solution that quite fits what I am trying to do. I have a long list of data in three columns. Below is a sample: 1,10,8 2,12,10 3,13,12 4,14,14 5,15,16 6,16,18 Please use code tags What I need to do is as follows: If a... (4 Replies)
Discussion started by: bleedingturnip
4 Replies
JPEGICC(1)						      General Commands Manual							JPEGICC(1)

NAME
jpegicc - little cms ICC profile applier for JPEG. SYNOPSIS
jpegicc [options] input.jpg output.jpg DESCRIPTION
lcms is a standalone CMM engine, which deals with the color management. It implements a fast transformation between ICC profiles. jpegicc is little cms ICC profile applier for JPEG. OPTIONS
-b Black point compensation. -c <0,1,2,3> Precalculates transform. (0=Off, 1=Normal, 2=Hi-res, 3=LoRes) [defaults to 1] -g Marks out-of-gamut colors on softproof. -h <0,1,2> Show summary of options and examples. -i profile Input profile (defaults to sRGB). -m <0,1,2,3> SoftProof intent. -n Ignore embedded profile. -p profile Soft proof profile -o profile Output profile (defaults to sRGB). -q <0..100> Output JPEG quality. -t <0,1,2,3> Intent (0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute). -v Verbose. EXAMPLES
To color correct from scanner to sRGB: jpegicc -iscanner.icm in.jpg out.jpg To convert from monitor1 to monitor2: jpegicc -imon1.icm -omon2.icm in.jpg out.jpg To make a CMYK separation: jpegicc -oprinter.icm inrgb.jpg outcmyk.jpg To recover sRGB from a CMYK separation: jpegicc -iprinter.icm incmyk.jpg outrgb.jpg To convert from CIELab ITU/Fax JPEG to sRGB jpegicc -iitufax.icm in.jpg out.jpg NOTES
For suggestions, comments, bug reports etc. send mail to info@littlecms.com. SEE ALSO
tifficc(1), icc2ps(1), icclink(1), icctrans(1), wtpt(1) AUTHOR
This manual page was written by Shiju p. Nair <shiju.p@gmail.com>, for the Debian project. September 30, 2004 JPEGICC(1)
All times are GMT -4. The time now is 07:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy