package SQL2text;
import java.util.*;
public class Main
{
public static void main(String[] args)
{
java.io.FileReader ficheroEntrada = null;
String linea;
String nombre;
System.out.println("Not enough parameters!");
System.out.print("Enter file name: ");
nombre = new Scanner(System.in).nextLine();
try
{
ficheroEntrada = new java.io.FileReader(nombre);
}
catch (RuntimeException e)
{
System.out.println(e.getMessage());
}
try
{
do
{
linea = ficheroEntrada.ReadLine();
if (linea != null)
{
System.out.println();
String tableName = linea.substring(12).split("[ ]", -1)[0];
String[] campo = tangible.StringHelper.substring(linea, linea.indexOf("(") + 1, linea.indexOf(")") - linea.indexOf("(") - 1).split("[,]", -1);
String[] valores = tangible.StringHelper.substring(linea, linea.indexOf("values (") + 9, linea.indexOf(");") - linea.indexOf("values (") - 9).split("[,]", -1);
System.out.println(tableName);
for (int i = 0; i < campo.length; i++)
{
System.out.print(campo[i].trim() + ": ");
System.out.println(valores[i].trim().replace("'", ""));
}
}
} while (linea != null);
}
catch (RuntimeException e)
{
System.out.println(e.getMessage());
}
new Scanner(System.in).nextLine();
}
}