Kun:LabNotes/MONOD/2015-4-21: Difference between revisions
Jump to navigation
Jump to search
>Shicheng No edit summary |
>Shicheng No edit summary |
||
Line 24: | Line 24: | ||
print"|}\n"; | print"|}\n"; | ||
</nowiki> | </nowiki> | ||
*corresponding table is as the following: | |||
{| class="wikitable" style="text-align: right; color: green;" | |||
| A1||A2||A3||A4||A5 | |||
|- | |||
| A2||A3||A4||A5||A6 | |||
|- | |||
| A3||A4||A5||A6||A7 | |||
|- | |||
| A4||A5||A6||A7||A8 | |||
|- | |||
| A5||A6||A7||A8||A9 | |||
|- | |||
| A6||A7||A8||A9||A10 | |||
|- | |||
| A7||A8||A9||A10||A11 | |||
|- | |||
| A8||A9||A10||A11||A12 | |||
|- | |||
| A9||A10||A11||A12||A13 | |||
|- | |||
| A10||A11||A12||A13||A14 | |||
|- | |||
| A11||A12||A13||A14||A15 | |||
|- | |||
| A12||A13||A14||A15||A16 | |||
|- | |||
| A13||A14||A15||A16||A17 | |||
|- | |||
| A14||A15||A16||A17||A18 | |||
|- | |||
| A15||A16||A17||A18||A19 | |||
|- | |||
|} |
Revision as of 17:58, 21 April 2015
- Now, I do know how to insert figures, but I don't know how to insert tables into MediaWiki. Therefore, I write 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: right; color: green;\"\n"; while(<F>){ chomp; my @line=split /\t/; my $tmp=join("||",@line); print "| $tmp\n|-\n"; } print"|}\n";
- corresponding table is as the following:
A1 | A2 | A3 | A4 | A5 |
A2 | A3 | A4 | A5 | A6 |
A3 | A4 | A5 | A6 | A7 |
A4 | A5 | A6 | A7 | A8 |
A5 | A6 | A7 | A8 | A9 |
A6 | A7 | A8 | A9 | A10 |
A7 | A8 | A9 | A10 | A11 |
A8 | A9 | A10 | A11 | A12 |
A9 | A10 | A11 | A12 | A13 |
A10 | A11 | A12 | A13 | A14 |
A11 | A12 | A13 | A14 | A15 |
A12 | A13 | A14 | A15 | A16 |
A13 | A14 | A15 | A16 | A17 |
A14 | A15 | A16 | A17 | A18 |
A15 | A16 | A17 | A18 | A19 |