ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/Redgrave/NTRS-TopSenderAnalysis.py
Revision: 797
Committed: Wed Sep 20 18:50:51 2023 UTC (2 years, 6 months ago) by nino.borges
Content type: text/x-python
File size: 1002 byte(s)
Log Message:
Very first version of a very simple program that will read multiple CSV files and export a report based on LanID and other general information.  This version is just gathering some test data.

File Contents

# User Rev Content
1 nino.borges 797 """
2    
3     NTRS-TopSenderAnalysis
4    
5     Created by:
6     Emanuel Borges
7     09.20.2023
8    
9     Very simple program that will read multiple CSV files and export a report based on LanID and other general information.
10    
11     """
12    
13     import csv, os
14    
15     if __name__ == '__main__':
16     startDir = r"C:\Users\eborges\Documents\Cases\Northern Trust"
17     test = []
18    
19    
20     for (root,dirs,files) in os.walk(startDir):
21     for fl in files:
22     with open(os.path.join(root,fl),mode='r',encoding='ANSI') as csv_file:
23     csv_reader = csv.DictReader(csv_file)
24     for row in csv_reader:
25     test.append(row['To'])
26     print(len(test))
27    
28     ## Initially gathering some very basic information across the CSV files, not using csv lib
29     # for (root,dirs,files) in os.walk(r"C:\Users\eborges\Documents\Cases\Northern Trust"):
30     # for fl in files:
31     # contents = open(os.path.join(root,fl), encoding='ANSI').readlines()
32     # print(f"{fl}|{len(contents)-1}")