
wickedxter
User
Nov 16, 2012, 5:11 PM
Post #2 of 3
(2280 views)
|
Re: [effc] help with extracting data points
[In reply to]
|
Can't Post
|
|
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...
#!/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)
|