I'm trying to scrape bing images using bulk-bing-image-downloader. I have a csv file that contains keywords and folder names in which I want the images to be saved:
keyword,folder,search
dog's house,animal,1
book.end,read,0
key chains,house,1
I'd like to use the values under keyword
and folder
as arguments to search and download images, and the value under search
as a conditional statement, where if it is 1, then the code performs the search, but not if it is 0. The basic bulk-bing-image-downloader code is:
./bbid.py -s "keyword" --limit 10 --adult-filter-off -o "folder"
where keyword
and folder
is where I'd like to loop through each row in the csv file. I currently have the bash command set up as, but I'm super new to shell commands and have zero idea how the awk works..help please?:
awk '
BEGIN {
-F,
FPAT = "([^,]+)|(\"[^\"]+\")"
}
{
if ($1 != "keyword") {
printf("%s\n", $1)
./bbid.py -s $1 --limit 10 --adult-filter-off -o $1
}
}
' test.csv