I have text files(100.txt,101.txt,102.txt) etc in a folder /Users/Don/Desktop/TextAuto. Now i wrote a script to extract certain info from each text file. Now i need to run this script for all the files ( 100.txt,101.txt,102.txt etc..).
I tried this : input.csv has text file names 100.txt,101.txt...
import re
import csv
with open ('input.csv') as csvfile :
readCSV = csv.reader(csvfile, delimiter=',')
for row in readCSV :
text1 = row[0]
text2 = row[1]
textopen = open('/Users/Don/Desktop/TextAuto/'+proto)
print(textopen)
Output : Instead of printing the content of textopen, it gave me ""
Another way i tried to do this is :
import re
import csv
with open ('input.csv') as csvfile :
readCSV = csv.reader(csvfile, delimiter=',')
for row in readCSV :
text1 = row[0]
print(text1)
Output : 100.txt
protoand what does it contain?