Created
February 7, 2012 05:42
-
-
Save kiyotakagoto/1757478 to your computer and use it in GitHub Desktop.
latex : 行と列の入れ替え(最低限の機能)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
my( @row ); | |
while(<STDIN>){ | |
chomp; | |
s/\s*\\\\\s*//g; | |
s/\\hline//g; | |
push @row, [split /\s*&\s*/]; | |
} | |
for( my $i = 0; $i <= $#{@{$row[0]}}; $i++ ){ | |
for( my $j = 0; $j <= $#row; $j++ ){ | |
$row[$j][$i] .= " & " if $j != $#row; | |
print $row[$j][$i]; | |
} | |
print " \\\\ \\hline\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment