File: prog.old

package info (click to toggle)
gap-hap 1.66%2Bds-1
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 55,348 kB
  • sloc: xml: 15,368; sh: 216; javascript: 155; makefile: 126; ansic: 57; perl: 36
file content (18 lines) | stat: -rwxr-xr-x 483 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl
#
# Program to convert image text files to GAP matrices. 

($file) = @ARGV;
#$file = '/tmp/im.txt';		# Name the file

open(INFO, $file);		# Open the file
my $line = <INFO>;
@parts = split /(:|,)/, $line;
print("HAPAAA:=[\n ",$parts[2],",",$parts[4],",");
while(<INFO>)		# Read it into an array
{
@parts = split m!(,|:|\(|\))!, $_;
print("[",1+$parts[0],",",1+$parts[2],",",$parts[6]+$parts[8]+$parts[10],"],");
};			# Print the array
print($my,"0];\n");
close(INFO);