I have created a txt file using python code which contents like as shown in image: 
I am writing a javascript code in a Nomagic Cameo system modeler . I am reading the file but I want to read all the given lines one by one into a variable and then use this variable to open these csv files in loop and do some processing.
So far I have written the following code but I am not sure how to correct it as per my requirement.
importPackage(org.w3c.dom);
importClass(java.io.File);
importClass(java.util.Scanner);
importClass (java.util.Scanner);
//importClass(java.io.BufferedReader);
importClass(javax.xml.parsers.DocumentBuilderFactory);
importClass(javax.xml.transform.OutputKeys);
importPackage(java.sql);
importClass(com.nomagic.magicdraw.automaton.AutomatonMacroAPI);
importClass(com.nomagic.magicdraw.openapi.uml.SessionManager);
java.lang.Class.forName("com.mysql.jdbc.Driver");
var conn = DriverManager.getConnection("jdbc:mysql://"+HostName+":"+Port,Username,Password);
var stat = conn.createStatement();
var resultSet = null;
var logger = com.nomagic.magicdraw.core.Application.getInstance().getGUILog();
var fileR = new File(FilePath);
//var sc = new Scanner(fileR);
var scanner = new Scanner(new File(fileR));
while (scanner.hasNextLine()) {
var line = scanner.nextLine();
print(line);
// process the line
}