sample csv:
Code: Select all
Product ID,Model,Description,Images
Product123,"Model 123","Description, color, black","http://www.123.com/1.jpg"
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
FileEncoding, UTF-8
FileSelectFile, csv_file, 1,, Select CSV File, *.csv
FileDelete, UTF-8_Image_Links.csv
FileRead, csv, %csv_file%
loop,parse,csv,`r,`n
{
if (A_Index=1)
FileAppend, id_product;Images URL, UTF-8_Image_Links.csv
if (A_Index>=2)
Loop, Parse, A_LoopField, csv
{
if (A_Index=1) ;Product ID
FileAppend, `n%A_LoopField%;, UTF-8_Image_Links.csv
else if (A_Index>=22 AND A_Index<31) ;images
if (A_LoopField!="")
FileAppend,%A_LoopField%`,, UTF-8_Image_Links.csv
}
}
ExitApp