Perl: Excel でブロックコピーして貼り付けたテキストを処理する ― 2005年11月18日 12時41分37秒
# Excel でブロックコピーして貼り付けたテキストを読み込んで何とかする # プログラムのサンプル use strict; our @sheet = (); my $line = []; my $quote; while (<>){ chomp; my @cells = split /\t/; if ($quote){ my $cell = shift @cells; my $text = $cell; $text =~ s!"+!'"' x int(length($&) / 2)!eg; $line->[$#$line] .= "\n$text"; $cell =~ s/""//; $cell =~ /"$/ or next; undef $quote; } if (@cells){ my $cell = pop @cells; push @$line, @cells; my $text = $cell; $cell =~ s/""//; if ($cell =~ /^"/ && scalar($cell =~ /"/g) % 2){ $quote = 1; $text =~ s!"+!'"' x int(length($&) / 2)!eg; } push @$line, $text; } } continue { push(@sheet, $line), $line = [] unless $quote; } for my $line (@sheet){ # 何とかする処理をここに記述... }
っていうか、クラス化しないまでも、せめて関数化しろよ>ヲレwww
マンション、ホテル 21 棟が書類上で耐震強度偽造 ― 2005年11月18日 18時34分31秒
偽造書類で建築確認、21棟が震度5強で倒壊の危険 (日本経済新聞)
ずさんな計算書を見落とし《耐震強度偽装》 認定番号の印字なし 検査機関処分も (読売新聞 - ヨミウリホームガイド)
耐震計算、偽造認める 建築士「仕事増やしたくて」 (朝日新聞)
ずさんな計算書を見落とし《耐震強度偽装》 認定番号の印字なし 検査機関処分も (読売新聞 - ヨミウリホームガイド)
耐震計算、偽造認める 建築士「仕事増やしたくて」 (朝日新聞)
こういうことやってっからマンション買う気が失せるんだよ。始めっからないけどな。
最近のコメント