I have a CSV with 4 fields (id1,id2,id3,filename) like this:
2,2314,78,/image/1289.jpg 1,19825,179,/image/01288.jpg 2,2585,2281,/image/01287.jpg 3,35879,82,/image/01286.jpg
There is a common URL endpoint for the images like
The last column is the unique portion of the URL to the image.
I'm trying to download each image, and name of each image is based on the first 3 fields:
id1 is always 1 digit
id2 is really 5 digits with prepending zeros (so 2314 needs to become 02314)
id3 is really 4 digits (78 becomes 0078),
so in total a 10 digit code. So the first image name should be 2023140078.jpg
If I were to download a single file manually, I'd do something like this:
wget -O 2023140078.jpg http://example.com/assets/?mediafile=/image/1289.jpg
Also if I could write back some sort of status or error code to the row or write an error log, would be great.