Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 22 file in different subfolder with same name. I write this code to read the files one after another. Each file has 28800 row and 207 column. I want to plot all read data at once for my choice of column.

What I have tried:

Python
import os, sys


# Specify directory
# In your case, you may want something like the following
my_directory = 'C:/Users/Arijeet/Downloads/Data/IRNSS2018-8-10_23-52-46'


# Define the counter
counter = 1

# Start the loop
for folder, sub_folders, files in os.walk(my_directory):
  for special_file in files:
    if special_file == 'iono_tropo.csv':
      file_path = os.path.join(folder, special_file)

      # Open and read
      with open(file_path, 'r+') as read_file:
        print('Reading iono_tropo csv file ' + str(counter))

        # Print the file
        for line in read_file:
          print(line)

        # Increment the counter
        counter += 1
Posted
Updated 25-Sep-18 20:12pm
v2
Comments
Richard MacCutchan 26-Sep-18 3:21am    
What is the question?
Member 13997748 26-Sep-18 3:23am    
how to plot graph from read data??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900