Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple csv files
#4
If you don't have access to os, you are at least given a list of the file names right? Otherwise I don't see how you can do it.

This is a way to read a file in a loop:

with open("results/expAAndrew12062013164623.csv", "r") as andrewfile:
    for line in andrew file:
        fields = line.strip().split(',')
You could put that in a for loop that cycles through the file names and reads them all, assuming they have the same format.

Also, please post code in python tags. See the BBCode link in my signature below for instructions on how to do that.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Multiple csv files - by beginner - Nov-03-2018, 12:11 PM
RE: Multiple csv files - by ichabod801 - Nov-03-2018, 01:54 PM
RE: Multiple csv files - by beginner - Nov-03-2018, 04:02 PM
RE: Multiple csv files - by ichabod801 - Nov-03-2018, 06:16 PM

Forum Jump:

User Panel Messages

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