summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Freeman <bf1936@att.com>2019-01-07 11:38:42 -0500
committerBrian Freeman <bf1936@att.com>2019-01-07 11:43:29 -0500
commitac727429e432d51893b487f350e4a8e2811d04a2 (patch)
treea50c58cc000319525f41f22626fbcaa2803a0e0f
parent21fcef50f0e3780cc786268937f9888c3b6facd1 (diff)
Add csv file helper
Issue-ID: INT-797 Change-Id: I187b1c882d087eee5df9ec49f7261c2b07332f28 Signed-off-by: Brian Freeman <bf1936@att.com>
-rw-r--r--eteutils/csvLibrary.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/eteutils/csvLibrary.py b/eteutils/csvLibrary.py
new file mode 100644
index 0000000..b38b4a5
--- /dev/null
+++ b/eteutils/csvLibrary.py
@@ -0,0 +1,16 @@
+import csv
+class csvLibrary(object):
+
+ def read_csv_file(self, filename):
+ '''This creates a keyword named "Read CSV File"
+
+ This keyword takes one argument, which is a path to a .csv file. It
+ returns a list of rows, with each row being a list of the data in
+ each column.
+ '''
+ data = []
+ with open(filename, 'rb') as csvfile:
+ reader = csv.reader(csvfile)
+ for row in reader:
+ data.append(row)
+ return data