summaryrefslogtreecommitdiffstats
path: root/robotframework-onap/eteutils/csvLibrary.py
diff options
context:
space:
mode:
Diffstat (limited to 'robotframework-onap/eteutils/csvLibrary.py')
-rw-r--r--robotframework-onap/eteutils/csvLibrary.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/robotframework-onap/eteutils/csvLibrary.py b/robotframework-onap/eteutils/csvLibrary.py
new file mode 100644
index 0000000..b38b4a5
--- /dev/null
+++ b/robotframework-onap/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