I need to pass an argument to the tcl from command line (this is done by a make target)
But I cannot run this script using tclsh. I have to source this file as a command line option of a binary file.
So when I do this,
home/bin/abc -do my.tcl ARG
binary errors out as it has an illegal...
I opened the file at the begining of the code. Sorry, I didn't post those lines here.
In your alogirthm,
if the last field is larger than those previously seen for this record type (or if it is the first record of this type)
save the field value in a hash of the largest values indexed by...
This is what I've tried so far. Please help.
sub comp()
{
if ($field1 != 0)
{
while (<IN_FILE>)
{
chomp;
$next_line = $_;
($next_name,$next_field2,$next_field3,$next_field4) = split(/\s+/,$next_line);
if ($field1 eq $next_name)
{
if ($next_field4 > $field4)...
Hello,
I'm a perl newbie and would appreciate your help here.
This is the file I have,
Arm -0.4 1.2 3.2
Bow 0.06 2.3 4.9
Arm 0.1 4.9 31.0
Pix -0.7 45.6 33.0
Gel 1.0 12.0 3.2
Arm 1.1 1.9 3.0
My columns of interest are 1 and 4. I want to uniquify column1 entries based on its...
The formatting for some reason gets messed up when I paste it here. My apologies.
Here's what we can do.
Instead of the (n-1)th row, column 1 value - we can grep for the line with "<-" and store its column 1 value.
For column 5 and column 7 values,
You are right about the spaces and tabs...
There are a lot of lines with incorrect number no fields. I'm not getting any errors after adding @a != 8 in the script, but there is no output either.
Here is the actual file,
Startpoint: A/XX
(rising edge-triggered flip-flop clocked by clk)
Endpoint: B/YY...
Thanks a lot Annihilannic.
When I exceute your code, I get the following error at this line,
% if ($a[5] eq '*') { $col5 = $a[4]; $col7 = $a[6]; }
Error,
Use of uninitialized value in string eq at parse.pl line 43, <IP_FILE> line 50070.
Thanks again.
John
I have two files with five columns each. I want to compare those two files and if the 1st and 3rd columns match, then I'd want to compute the difference between 5th column values. Here's what I have and it doesn't seem to work (no outputs). Can somebody help please?
#! /usr/bin/perl...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.