Kun:LabNotes/MONOD/2015-4-21: Difference between revisions
Jump to navigation
Jump to search
>Shicheng (Created page with " <nowiki> #!/usr/bin/perl #table2wikitable.pl use strict; use Cwd; chdir getcwd; my $input=@ARGV[0]; open F,$input; print "{| class=\"wikitable\" style=\"text-align: cente...") |
>Shicheng No edit summary |
||
Line 1: | Line 1: | ||
**Now, I known how to insert figures, but I don't know how to insert tables into medianwiki. Therefore, I prepared a small code to transfer routine table to wikitable. | |||
perl table2wikitable.pl input.table.txt | |||
<nowiki> | <nowiki> |
Revision as of 17:55, 21 April 2015
- Now, I known how to insert figures, but I don't know how to insert tables into medianwiki. Therefore, I prepared a small code to transfer routine table to wikitable.
perl table2wikitable.pl input.table.txt
#!/usr/bin/perl #table2wikitable.pl use strict; use Cwd; chdir getcwd; my $input=@ARGV[0]; open F,$input; print "{| class=\"wikitable\" style=\"text-align: center; color: green;\"\n"; while(<F>){ chomp; my @line=split /\t/; my $tmp=join("||",@line); print "| $tmp\n|-\n"; } print"|}\n";