Q:

Download URLs from CSV into subdirectory given in first field

So I want to export my products into my new website.  I have an csv file with these data:
product id,image1,image2,image3,image4,image5
1,https://img.url/img1-1.png,https://img.url/img1-2.png,https://img.url/img1-3.png,https://img.url/img1-4.png,https://img.url/img1-5.png
2,https://img.url/img2-1.png,https://img.url/img2-2.png,https://img.url/img2-3.png,https://img.url/img2-4.png,https://img.url/img2-5.png

What I want to do is to make a script to read from that file, make directory named with product id, download images of the product and put them inside their own folder (folder 1 => image1-image5 of product id 1, folder 2 => image1-image5 of product id 2, and so on). 
I can make a normal text file instead of using the excel format if it's easier to do.  Thanks before. 
Sorry I'm really new here.  I haven't done the code yet because I'm clueless, but what I want to do is something like this:
for id in $product_id; do
  mkdir $id && cd $id && curl -o $img1 $img2 $img3 $img4 $img5 && cd ..
done

A:

If you followed the good advice that @Aaron gave you, this code can help you, as you seem to be new with bash I commented out the code for better comprehension.  
#! /bin/bash

# your csv file
myFile=products.csv

# number of lines of file
nLines=$(wc -l $myFile | awk '{print $1}')

echo "Total Lines=$nLines"

# loop over the lines of file
for i in `seq 1 $nLines`;
    do
        # first column value
        id=$(sed -n $(($i+1))p $myFile | awk -F ";" '{print $1}')

        line=$(sed -n $(($i+1))p $myFile)

        #create the folder if not exist
        mkdir $id 2>/dev/null

        # number of images in the line
        nImgs=$(($(echo $line | awk -F ";" '{print NF-1}')-1))

        # go to id folder
        cd $id
        #loop inside the line values
        for j in `seq 2 $nImgs`;
            do
                # getting the image url to download it
                img=$(echo $line | cut -d ";" -f $j)
                echo "Downloading image $img**";echo
                # downloading the image
                wget $img
        done 
        # go back path
        cd ..
done

