Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. johnsbn

    pass an arg to a tcl script, which itself is called by a binary

    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...
  2. johnsbn

    Uniquify a column based on values of another column

    Thanks Ann.
  3. johnsbn

    Uniquify a column based on values of another column

    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...
  4. johnsbn

    Uniquify a column based on values of another column

    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)...
  5. johnsbn

    Uniquify a column based on values of another column

    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...
  6. johnsbn

    Processing and not just parsing a file -- Please help !

    Ann, I got it to work. I tried using the way I described and was able to get it working. Thanks a lot to you. Really appreciate your help. - John
  7. johnsbn

    Processing and not just parsing a file -- Please help !

    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...
  8. johnsbn

    Processing and not just parsing a file -- Please help !

    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...
  9. johnsbn

    Processing and not just parsing a file -- Please help !

    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
  10. johnsbn

    Processing and not just parsing a file -- Please help !

    Hello all, I have a file similar to this, (about 1G) ================================================== startpoint: AAA endpoint: BBB # body for every start/end combo a/Xxxxxx yyy num1 num2 num3 & num4 . . . a/ttttttt fff num4 num5 num6 * num722 b/ttttttt fff num44 num50 non_zero * num734 . ...
  11. johnsbn

    Help in debugging

    >> What separates the columns, commas? one or more spaces. These are pretty huge files, 3G each. Any alternative suggestions are welcome.
  12. johnsbn

    Help in debugging

    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...

Part and Inventory Search

Back
Top