aboutsummaryrefslogtreecommitdiff
path: root/Auxiliary/Cactus/IOASCII.m
diff options
context:
space:
mode:
Diffstat (limited to 'Auxiliary/Cactus/IOASCII.m')
-rw-r--r--Auxiliary/Cactus/IOASCII.m26
1 files changed, 26 insertions, 0 deletions
diff --git a/Auxiliary/Cactus/IOASCII.m b/Auxiliary/Cactus/IOASCII.m
new file mode 100644
index 0000000..118db8d
--- /dev/null
+++ b/Auxiliary/Cactus/IOASCII.m
@@ -0,0 +1,26 @@
+
+BeginPackage["IOASCII`"];
+
+ReadIOASCII::usage = "ReadIOASCII[file] reads the IOASCII file and parses it into list format";
+MGraph::usage = "MGraph[file] plots the IOASCII file";
+
+Begin["`Private`"];
+
+ReadIOASCII[file_] :=
+ Module[{data1, data2, data3},
+ data1 = Import[file, "Table"];
+ data2 = Select[SplitBy[data1, Length[#] == 0 &], #[[1]] != {} &];
+ data3 = Map[{First[#][[3]], Drop[#, 1]} &, data2]];
+
+MGraph[file_String] :=
+ Module[{data = ReadIOASCII[file]},
+ MGraph[data]];
+
+MGraph[data_List] :=
+ Module[{},
+ Manipulate[
+ ListLinePlot[data[[it, 2]], PlotLabel -> data[[it, 1]]], {{it,1,"it"}, 1, Length[data], 1}]];
+
+End[];
+
+EndPackage[];