-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinputs_to_tex.pl
executable file
·49 lines (35 loc) · 957 Bytes
/
inputs_to_tex.pl
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/perl -s
# Copyright (C) 2002 Regents of the University of Michigan, portions used with permission
# For more information, see http://csem.engin.umich.edu/tools/swmf
$help = $h;
open(INFILE,"<set_inputs.f90");
open(OUTFILE,">set_inputs.tex");
while (<INFILE>) {
if (/Incorrect format/) {
$IsDone=0;
while (!$IsDone) {
$line = <INFILE>;
if (!($line =~ /\#/)) {
if ($line =~ /(write\(\*,.*\)\s)[\'\"](.+)[\'\"]/) {
print OUTFILE "$2\n";
}
} else {
$IsDone = 1;
}
# print OUTFILE "$2\n" if (!$IsDone);
}
print OUTFILE "\\begin{verbatim}\n";
print OUTFILE "$2\n" if ($line =~ /(write\(\*,.*\)\s)[\'\"](.+)[\'\"]/);
$IsDone=0;
while (!$IsDone) {
$line = <INFILE>;
$IsDone=1 if (!($line =~ /(write\(\*,.*\)\s)[\'\"](.+)[\'\"]/));
print OUTFILE "$2\n" if (!$IsDone);
}
print OUTFILE "\\end{verbatim}\n";
print OUTFILE "\n";
}
}
close(INFILE);
close(OUTFILE);
exit(1);