Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read value from a CSV
#1
Ciao,

I'm basically new with python. I have a CSV like the one one attached and I want save each column (without the ";") into a variable.
I need a while loop.
Until now I've understood only how to open the CSV and in case make a print of it

with open('C:\python\csv_prova.csv') as csv_file:
    csv_reader = csv.reader(csv_file, delimiter=';')
   
    for i in csv_reader:
        for j in i:
           print(j, end=" ") 
     print("")
but with the loop and how to get the single value I'm a bit lost. can you help me? thanks

Attached Files

.csv   csv_prova.csv (Size: 189 bytes / Downloads: 196)
Reply


Messages In This Thread
Read value from a CSV - by martinmistere - Jun-01-2022, 02:50 PM
RE: Read value from a CSV - by Axel_Erfurt - Jun-01-2022, 07:40 PM
RE: Read value from a CSV - by Pedroski55 - Jun-04-2022, 10:48 PM
RE: Read value from a CSV - by martinmistere - Jun-06-2022, 02:24 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020