Edited because it seems as though I was too vague or didn't show enough research. My apologies (newbie here).
I am trying to read a csv file and assign each new line as a value to iterate through a script that writes to an API. There's no header data in my csv. I'll be adding a regex search and then using the data that follows the regex expression and assign it as a variable to iterate through my script if that makes sense.
CSV Contents:
Type1, test.com
Type2, name.exe
Type3, sample.com
Basic premise of what I want to do in Python:
Read from CSV Script runs with each line from the CSV as a variable (say Variable1). The script iterates until it is out of values in the csv list, then terminates. An example for the script syntax could be anything simple...
#!/usr/bin/python
import requests
import csv
reader = csv.reader(open('test.csv'))
for row in reader:
echo line-item
until the script runs out of Variables to print, then terminates. Where I'm struggling is the syntax on how to take a line then assign it to a variable for the for loop.
I hope that makes sense!