String s = "1,167,2,'LT2A',45,'Weekly','1,2,3,4,5,6,7,8,9,10,11,12,13'";
Scanner sc = new Scanner(s);
sc.useDelimiter(",");
while (sc.hasNext()) {
String n = sc.next();
if (n.startsWith("'") && !n.endsWith("'")) {
n = n + sc.findInLine(".+?'");
}
System.out.println(n);
}
}