I made the change in the code and attached the output, but it looks like the value is column 1 is off and that the values are shifted by a column. Thank you .
Code:
#!/bin/perl
use strict;
# Accept the input and output files as parameters
my $input_file = $ARGV[0];
my $output_file = $ARGV[1];
# Set the header columns to be added to the left
# and to the right of the header in the input file
my @left = (
"Index",
"Chromosome Position",
"Gene",
"Inheritance",
"RNA Accession",
"Chr",
"Coverage",
"Score",
"A(#F,#R)",
"C(#F,#R)",
"G(#F,#R)",
"T(#F,#R)",
"Ins(#F,#R)",
"Del(#F,#R)",
"SNP db_xref",
"Mutation Call",
"Mutant Allele Frequency",
"Amino Acid Change"
);
my @right = (
"HP",
"SPLICE",
"Pseudogene",
"Classification",
"HGMD",
"Disease",
"Sanger",
"References"
);
# open the input file, read the header line and sandwich it
# between @left and @right arrays
my $final_header;
open (FH, "<", $input_file) or die "Can't open $input_file: $!";
chomp(my $hdr=<FH>);
$final_header = sprintf("%s\t%s\t%s\n", join("\t", @left), $hdr, join("\t",@right));
# final header is set, print it to the output file
open (OF, ">", $output_file) or die "Can't open $output_file: $!";
print OF "$final_header";
# close (FH) or die "Can't close $output_file: $!";
my @colsleft = map "Null",(0..$#left);
my @colsright = map "Null",(0..$#right);
while(<FH>) { # puts row of input file into $_
chomp;
print OF join("\t",$.,@colsleft,$_,@colsright),"\n"; # row data is set, print it to the output file
}
Greetings.
I'm having a time of it with this file. I'm trying to do a script that will take two command line inputs, string1 and string2 and use sed to change the text over files in the current directory. This is what I have so far. It appears to work a little, it does create the... (3 Replies)
I can not for the life of me figure out how to iterate over this array
{
'name1' => {
'a' => .
'b' =>
},
'name2' => {
'a' => .
'b' =>
}
}
I want a for loop to iterate through the first element (name1 and name2 in my example) but I can't figure it out. Help... (2 Replies)
Hi,
I have a directory call Test, which contains files "a", b", "c", etc. I want to go through all of the files inside Test and remove any empty file. How would I do that with shell csh?
So far I got...
#!/bin/csh
if (($#argv == 0) || ($#argv > 1)) then
echo "no argument or too... (2 Replies)
Hi,
I am writing a comparator script, which comapre two txt files(column by column)
below are the precondition of this comparator
1)columns of file are not seperated
Ex.
file1.txt
8888812341181892
1243548895685687
8945896789897789
1111111111111111
file2.txt
9578956789567897... (2 Replies)
Hi
i need to find x in the following equation such that it satisfies this condition:
y/x-ln(x)-1.24=0
how can i write a script to iterate to give random x to satisfy this equation.
y is different each time too. any help with awk/shell script will be awesome!
thanks (1 Reply)
I'm trying to send the file list as parameter to another job and execute it.
But the loop doesn't work, the inner job is running only once and not twice as expected
for filelist in $(ls -rt *.txt | tail -2)
do
echo $filelist
export filelist
cmd="$Program -config $configfile -autoexec... (11 Replies)
Have two 3 files which has list of servers,users and location and base url which is common on every server
A = server1 server2 server3
B = user1 user2 user3
C = dom1 dom2 dom3
baseurl=/opt/SP/
and what i have to achieve is below via ssh from REMOTE SERVER
for it's first iteration it... (7 Replies)
I would like to iterate over `dirs`in a script, but the script will never show more than one (current) folder
#! /bin/bash
for i in `dirs`
do
echo ${i}
done
echo ++++++++++++++++++
for i in $( dirs -p )
do
echo ${i}
done
echo ------------------
dirscontent=`dirs`
echo... (5 Replies)
I have a job that produces a file of barcodes that gets added to every time the job runs
I want to check the list to see if the barcode is already in the list and report it out if it is. (3 Replies)
Discussion started by: worky
3 Replies
LEARN ABOUT DEBIAN
mousex::nativetraits::bool
MouseX::NativeTraits::Bool(3pm) User Contributed Perl Documentation MouseX::NativeTraits::Bool(3pm)NAME
MouseX::NativeTraits::Bool - Helper trait for Bool attributes
SYNOPSIS
package Room;
use Mouse;
has 'is_lit' => (
traits => ['Bool'],
is => 'rw',
isa => 'Bool',
default => 0,
handles => {
illuminate => 'set',
darken => 'unset',
flip_switch => 'toggle',
is_dark => 'not',
},
);
my $room = Room->new();
$room->illuminate; # same as $room->is_lit(1);
$room->darken; # same as $room->is_lit(0);
$room->flip_switch; # same as $room->is_lit(not $room->is_lit);
return $room->is_dark; # same as !$room->is_lit
DESCRIPTION
This provides a simple boolean attribute, which supports most of the basic math operations.
PROVIDED METHODS
These methods are implemented in MouseX::NativeTraits::MethodProvider::Bool. It is important to note that all those methods do in place
modification of the value stored in the attribute.
set Sets the value to true.
unset
Set the value to false.
toggle
Toggles the value. If it's true, set to false, and vice versa.
not Equivalent of 'not $value'.
METHODS
meta
method_provider_class
helper_type
SEE ALSO
MouseX::NativeTraits.
perl v5.14.2 2011-12-04 MouseX::NativeTraits::Bool(3pm)