Use of "Command line perl" in perl script using system command.
I have not getting result, so I am describing my problem in deep.
MY QUERY :
>HUMAN1 ||elongation factor 2|HUMANA 43|||Manual
>HUMAN2 |||elongation factor 5|HUMANA 87|||Manual
>HUMAN3 |elongation factor 1|HUMANA 68|||Manual
AND SO ON...
I WANT :
elongation factor 2
elongation factor 5
elongation factor 1
MY PERL SCRIPT :
print "enter yr keyword \n";
system("grep '^>' ".$ok1.".txt >".$ok1."_head.txt");
#[ NOTE :(Above system part is working for 'grep' command and i am getting result in
# ".$ok1."_head.txt"). ]
my $x=qw(perl -na -F'/\|+/' -e 'print "$F\n"' ".$ok1."_head.txt" >".$ok1."6.txt");
# [ NOTE : this will create a file ".$ok1."6.txt" But it is empty, it means that it
# is not working ]
Would anyone help me?
Either "escape" the + sign or do it like this
`perl -na -F'/\|+/' -e 'print \"$F\n\"' a1.txt >a2.txt"`
my $x=qw(perl -na -F'/\|+/' -e 'print \"$F\n\"' a1.txt >a2.txt);
system("perl -na -F'/\|\+/' -e 'print \"$F\n\"' a1.txt >a2.txt");
Reply to SethsdadtheLinuxer
I have tried your 3 options, but I am not getting
answer, thats why I have described my QUERY in deep.
I think now you can understand it properly.
I'm not sure exactly what you're trying to do, but if you want to extract the "elongation factor 2" type fields out of the ok1.txt file, then you could just use the split command (error trapping not included).
Reply to "speck"
Thank you for your reply.
I am getting your point, but
I want to SOLVE THE PROBLEM
using command line option only.
You have given "\|+" option
for solution that I have used
in perl program, but Its not
working in "COMMAND LINE" option.
|All times are GMT -5. The time now is 01:32 PM.|