Created
February 18, 2015 03:53
-
-
Save konoha81/0dd35b866c7a3514b789 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env perl | |
use strict; | |
open(IN,"cell.txt") or die("error!"); | |
my @Name; | |
my @Q2; | |
my @Q3; | |
while(<IN>){ | |
chomp; | |
$_ =~ s/"//g; | |
# 前スペースを削除 | |
$_ = <rim($_); | |
my($name,$stat,$cells) = split(/\t/,$_); | |
print("Hello\n"); | |
# 名前を格納 | |
if($name =~ /^Specimen/){ | |
push(@Name,$name); | |
} | |
# Q2, Q3のセル数を格納 | |
if($name =~ /Q2/){ | |
push(@Q2,$cells); | |
}elsif($name =~ /Q3/){ | |
push(@Q3,$cells); | |
} | |
} | |
close(IN); | |
for(my $i=0; $i<=$#Name;$i++){ | |
print $Name[$i]."\n"; | |
print $Q2[$i]."\n"; | |
} | |
# 前スペースを削除する | |
sub ltrim { | |
my $val = shift; | |
$val =~ s/^\s*//; | |
return $val; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment