Add csv file helper 90/75390/1
authorBrian Freeman <bf1936@att.com>
Mon, 7 Jan 2019 16:38:42 +0000 (11:38 -0500)
committerBrian Freeman <bf1936@att.com>
Mon, 7 Jan 2019 16:43:29 +0000 (11:43 -0500)
Issue-ID: INT-797
Change-Id: I187b1c882d087eee5df9ec49f7261c2b07332f28
Signed-off-by: Brian Freeman <bf1936@att.com>
eteutils/csvLibrary.py [new file with mode: 0644]

diff --git a/eteutils/csvLibrary.py b/eteutils/csvLibrary.py
new file mode 100644 (file)
index 0000000..b38b4a5
--- /dev/null
@@ -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