CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [effc] help with extracting data points : Edit Log



wickedxter
User

Nov 16, 2012, 5:11 PM


Views: 839
Re: [effc] help with extracting data points

remember to use the code blocks in the forum it helps in readability.... I went threw and i think i fixed what i saw that was wrong...


Code
#!/usr/bin/perl  
# parse an .xlsx output file and create single data file for each animal id/probe

print "JJ.xlsx\n";

my $file = <>;
my $file =~ s/\s+$//;

my $counter = 0;

my %nameHash = ();


open (my $file_handle, '<' , "$file" ) or die("Cant open $file, $!");
while ($file_line = <$file_handle>) {
if ($counter < 1) {
$counter = $counter + 1;
my @CODELINK_ID = split('\t', $file_line);
my $CODELINK_ID = scalar(@CODELINK_ID);
$CODELINK_ID = $CODELINK_ID - 1;
my $Count = 0;

print "$counter and $Count and $CODELINK_ID\n";

while ($Count < 0) {
$Count = $Count + 1;
my $nextArray = pop(@CODELINK_ID);
$nextArray =~ s/\s+$//;
$nextArray =~ s/\.txt//i;

open (OUT, ">$nextArray") or die("Cant open $nextArray, $!");
print OUT "ID\n";
close OUT;

$nameHash{$Count} = $nextArray;
print "$Count and $nextArray\n";
}
}
}



(This post was edited by wickedxter on Nov 16, 2012, 5:12 PM)


Edit Log:
Post edited by wickedxter (User) on Nov 16, 2012, 5:12 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives