Advertisement
smbarbour

MapWriter -> AnvilMapper Color file converter

Jan 21st, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.39 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2. use strict;
  3.  
  4. open (IN, "<", $ARGV[0]);
  5.  
  6. while (<IN>) {
  7.         my $line = $_;
  8.         my @field = split(' ',$line);
  9.         if ($field[1] ne "*") { $field[1] = sprintf('%03x', $field[1]); }
  10.         if (substr($field[0],0,2) eq "bl") {
  11.                 if ($field[2] ne "*") { $field[2] = sprintf('%x', $field[2]); }
  12.         }
  13.         print join(' ', @field) . "\n";
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement