From 4a53c652e24b98258889c48f89c46b6fe065df09 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 13 Dec 2013 16:28:54 -0800 Subject: Convert structure list of supported dive computers to txt / html This adds a silly perl script to create either a txt or html file from the structured descriptor3.tsv file. This way we can maintain the structured file and easily create both text and html output from it. Instead of somehow adding this to qmake I decided to simply add the two output files so that they are included in the source tar file. Recreate them by running perl scripts/parse-descriptor.pl descriptor3.tsv SupportedDivecomputers.html perl scripts/parse-descriptor.pl descriptor3.tsv SupportedDivecomputers.txt Signed-off-by: Dirk Hohndel --- scripts/parse-descriptor.pl | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 scripts/parse-descriptor.pl (limited to 'scripts/parse-descriptor.pl') diff --git a/scripts/parse-descriptor.pl b/scripts/parse-descriptor.pl new file mode 100644 index 000000000..604bfe568 --- /dev/null +++ b/scripts/parse-descriptor.pl @@ -0,0 +1,39 @@ +use Carp; + +#set command line arguments +my ($infi, $outfi) = @ARGV; +my ($type) = $outfi =~ /\.([^.]+)$/; + +open(my $fh, "<", $infi) || croak "can't open $infi: $!"; +open(STDOUT, ">", $outfi) || croak "can't open $outfi: $!"; + +my $lastVend = ""; +while (<$fh>) { + my ($vend, $mod, $set) = split('\t', $_); + if ($type eq "html") { + if ($vend eq $lastVend) { + printf(", %s", $mod); + } else { + if ($lastVend eq "") { + printf("