aboutsummaryrefslogtreecommitdiff
path: root/Auxiliary/Cactus/IOASCII.m
blob: 118db8dd14362541c0e62d0c4e908d263d9150c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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[];