User Profile

Collapse

Profile Sidebar

Collapse
lilly07
lilly07
Last Activity: Feb 24 '11, 11:41 PM
Joined: Jul 15 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • lilly07
    replied to Call java jar from perl script
    in Perl
    Hi miller,
    Thanks for your response. This is something new that I have learnt.
    See more | Go to post

    Leave a comment:


  • lilly07
    started a topic Call java jar from perl script
    in Perl

    Call java jar from perl script

    Hi,
    I have to call ' java -jar name.jar arg1 arg2' in my perl script. The java prints a string if we invoke the above command How to capture this information.
    Thanks and regards.
    See more | Go to post

  • Thanks Jeff.
    See more | Go to post

    Leave a comment:


  • lilly07
    started a topic How to find if the number exists in a range?
    in Perl

    How to find if the number exists in a range?

    Basically, I want to check whether $x is in between $y and $z.

    I always compare them with simple if statement as below.

    Code:
    if(($x > $y) && ($x < $z))
    Any other way of doing this in a better manner available? Thanks.
    See more | Go to post

  • lilly07
    replied to shell command inside perl script
    in Perl
    Thx Orally for you help. Finally
    Code:
    egrep '    1\$\'
    worked.
    See more | Go to post

    Leave a comment:


  • lilly07
    replied to shell command inside perl script
    in Perl
    Hi,
    Thx for your response. My data is tab delimited columns. Hence I wanted to grep lines with last column as 1. So I used (control+v then tab key to get
    ' $1' the last column which ends with 1. I will try with egrep. When I just use a she ll script with above description, it works and hence I constructed as system command inside my perl script. But it doesn't work as my syntax is wrong. Thanks again.
    See more | Go to post

    Leave a comment:


  • lilly07
    started a topic shell command inside perl script
    in Perl

    shell command inside perl script

    I am trying to use a shell grep command inside a perl script using system command as below.

    Code:
     system "cat $source_path/s_${i}_${j}_0*testing.txt | grep '     $1'  | head > $path/s_${i}_${j}.txt";
    I am trying to grep for lines that ends with 1 inside the system command. system command concatenates everything and writing into output file and grep ' $1' does not work. I tried with double...
    See more | Go to post

  • lilly07
    replied to Getting argument as filename or STDIN
    in Perl
    Thanks forr your help Jeff.
    See more | Go to post

    Leave a comment:


  • lilly07
    started a topic Getting argument as filename or STDIN
    in Perl

    Getting argument as filename or STDIN

    I am trying to read a file. The file contents can be either STDIN or a file name.

    When it is from a file, I open as follows.
    Code:
    Open filename ($filename)
    While(<$filename>){
    #process each line
    }
    Otherwise if it is from STDIN, I always use
    Code:
    while(<>){
    #process each line
    }
    Now my constraint is the user can either specify the file name...
    See more | Go to post
    Last edited by numberwhun; Nov 27 '10, 09:30 PM. Reason: Please always use code tags.

  • lilly07
    replied to doubts about shell scripting!
    Echo statement inside the for loop is correctly printing the file path. But I get to to see theerror like "cat... No file found " three times because the path is broken. How can it happen? How can the path gets broken in the cat statement but not in echo statement. Please clarify. Thanks in advance.

    Is there any problem because of line 11 and 12 of my code as I am trying to get the name of the file from directory path. No clue...
    See more | Go to post

    Leave a comment:


  • lilly07
    started a topic doubts about shell scripting!

    doubts about shell scripting!

    I am trying to concatenate some 100 files from one directory and writing them into another directory and I want to automate this as follows:

    But cat statement inside for loop does not work. But echo statement inside the for loop shows the correct path to the files? Why is it not concatenating files? I am new to shell scripting. Thanks in advance.

    Code:
    if [ $# -lt 4 ]
            then
               echo Usage:
    ...
    See more | Go to post

  • lilly07
    started a topic perl merging data
    in Perl

    perl merging data

    Hi I need to merge my data as below and its highly confusing and please let me know how to do.

    Code:
    3       131835844       131835943       3       131830073       131830172
    18      33659786        33659885        18      33653576        33653675
    2       146593375       146593474       2       146578884       146578983
    3       83938058        83938157        3       83935615        83935714
    4       46493910
    ...
    See more | Go to post

  • lilly07
    started a topic remove lines from a huge text file
    in Perl

    remove lines from a huge text file

    Hi,
    I have a 10 million record in a tab delimited text file (data.txt) and I have another file with line numbers (line_num.txt).
    My data.txt is as follows
    Code:
    first 1  res  234
    sec   23 fre  890
    dec   26 der  690
    ...
    My line_num.txt is as follows:
    Code:
    23
    456
    3467
    ...
    I have to remove the lines ( 23rd, 456th, 3467th) line from...
    See more | Go to post

  • lilly07
    replied to perl hash data
    in Perl
    Thanks Ron. Thats a great help..
    See more | Go to post

    Leave a comment:


  • lilly07
    replied to perl hash data
    in Perl
    Hi to be frank,
    I have not used perl HoH before and still confusing after seeing some examples. I tried as beolw and am not able to achieve as I said above.

    Code:
    while ( <> )
    
    {
             chomp $_;
            @v = split(/\t/,$_);
            $bin = $v[2];
    
             $key = $v[1];
            $value = $v[1];
             $HoH{$bin}{$key} = $value;
    }
    ...
    See more | Go to post

    Leave a comment:


  • lilly07
    replied to perl hash data
    in Perl
    Hi thx fir the response...
    See more | Go to post

    Leave a comment:


  • lilly07
    started a topic perl hash data
    in Perl

    perl hash data

    Hi,

    I have a doubt regarding perl hash data. I have a tab delimited as below:

    file1.txt

    Code:
    name1   AM   bin1
    name2   AM   bin1
    name3   PM   bin1
    name4   AM   bin2
    name5   AM   bin1
    name6   PM   bin2
    My objective would be to count the anumber of AM and PM according to the bin number as below:


    bin1 3AM 1PM
    ...
    See more | Go to post

  • lilly07
    replied to perl search algorithm
    in Perl
    Hi Jeff,

    my sample test2.txt contains the following in the 13th and 35th column.

    Code:
    57583225        57580491
    57583262        57580492
    58049166        58012648
    57583215        57580442
    59416357        59435981
    56506459        56164151
    63518481        63509149
    58053224        58138139
    59675405        60296224
    59675408        60296279
    ...
    See more | Go to post

    Leave a comment:


  • lilly07
    started a topic perl search algorithm
    in Perl

    perl search algorithm

    Hi, there are two text files as below:

    test1.txt

    Code:
    53015910        53018079
    53028477        53039398
    53057449        53060200
    53062918        53067636
    53068725        53070903
    53073104        53082405
    53157340        53159848
    53162114        53164278
    53170778        53177010
    53186077        53190880
    test2.txt is a tab delimited...
    See more | Go to post

  • lilly07
    replied to perl hash doubt
    in Perl
    Yes. Thank you so much for your response.

    I managed to remove duplicates as below. A very simple way.

    Code:
     %seen = ();
    while(<>){
          $seen{$_}++;
          next if $seen{$_} > 1;
          print "$_";
       }
    As I don't know how to compare between two hashes, I couldn't proceed further. I will definitely follow pushing the data in to perl key and array as you suggested....
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...