mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-07-23 03:18:43 +08:00
📝 optimize code format
This commit is contained in:
+6
-6
@@ -1,16 +1,16 @@
|
||||
# lib csv.nas
|
||||
# ValKmjolnir 2022/10/15
|
||||
var read_csv=func(path,delimeter=",",endline="\n"){
|
||||
var context=io.readfile(path);
|
||||
context=split(endline,context);
|
||||
var read = func(path, delimeter=",", endline="\n"){
|
||||
var context = io.readfile(path);
|
||||
context = split(endline, context);
|
||||
forindex(var i;context){
|
||||
context[i]=split(delimeter,context[i]);
|
||||
context[i] = split(delimeter,context[i]);
|
||||
}
|
||||
if(size(context)<=1){
|
||||
die("incorrect csv file <"~path~">: "~size(context)~" line(s).");
|
||||
}
|
||||
return {
|
||||
property:context[0],
|
||||
data:context[1:]
|
||||
property: context[0],
|
||||
data: context[1:]
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user