User Profile

Collapse

Profile Sidebar

Collapse
cckramer
cckramer
Last Activity: Jan 8 '09, 02:03 AM
Joined: Dec 9 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • cckramer
    started a topic pick out the differing entries between 2 files
    in Perl

    pick out the differing entries between 2 files

    Hi,
    If I have 2 arrays and one has (say) 10 names(as entries)and the other has the same 10 names + 2 more new ones, what short code can help me pick out the 2 new names in the 2nd file ?

    Thanks
    See more | Go to post

  • cckramer
    replied to hash of a hash
    in Perl
    Thank for all those who helped.My code that I posted earlier to create a hash of hash of hash worked.
    Code:
    (keys{$ blocks{$inputs}{$outputs}})
    See more | Go to post
    Last edited by numberwhun; Dec 19 '08, 03:08 PM. Reason: Please use code tags

    Leave a comment:


  • cckramer
    replied to hash of a hash
    in Perl
    Thank you.I shall keep that in mind for the future
    See more | Go to post

    Leave a comment:


  • cckramer
    replied to hash of a hash
    in Perl
    Thanks

    Thanks. I shall give it a shot..also I tried this rough code.Is this okay ?
    Code:
    # check if line starts with "delay"
     if ($line =~ /^delay/) {
    
    # regular expression to get the inputs & outputs
       $line =~ m/\-from\s+\[\s+(.*)\]\s+\-to\s+\[\s+(.*)\]/;
    
    # inputs & block information
       $in = $1;
       @in1 = split(/\//, $in);
       $blockin = $in1[0];
    ...
    See more | Go to post
    Last edited by numberwhun; Dec 18 '08, 06:12 PM. Reason: Please use code tags

    Leave a comment:


  • cckramer
    replied to copying more than one line to another file
    in Perl
    Appreciate the help offered.Also for trying to correct my ways in the other forum.
    See more | Go to post

    Leave a comment:


  • cckramer
    replied to copy a file
    in Perl
    I'm sorry to to not have thanked the posters earlier.Appreci ate the help
    See more | Go to post

    Leave a comment:


  • cckramer
    started a topic hash of a hash
    in Perl

    hash of a hash

    I have this info' in a file.

    blockA/input1 to block A/output1 delayXX
    blockA/input1 to blockA/output2 delayYY
    blockA/input1 to blockA/output3 delayZZ

    blockB/input1 to blockB/output1 delayPP

    blockC/input1 to blockC/output1 delayQQ
    blockC/input2 to blockC/output1 delayRR

    how to store the inputs and outputs for each block as shown above ? in 2 hashes or arrays ? I am not...
    See more | Go to post

  • cckramer
    started a topic copying more than one line to another file
    in Perl

    copying more than one line to another file

    When I read file A , it has these lines like that need to be reproduced:



    Input a, b, c,

    X,Y;



    Output m,n

    , f,g;



    How do I reproduce this in the new file ?

    Basically when I read “file A” line by line, I search for first word and if it’s “input” I need to start copying from there till the semicolon...
    See more | Go to post
    Last edited by numberwhun; Dec 17 '08, 08:05 PM. Reason: Please use code tags

  • cckramer
    started a topic copy a file
    in Perl

    copy a file

    Hi,
    I want to do a backup of a file from one area where I don't have write permission onto my area where I do have write permission ?How to do it ?
    do I do a copy first and then a rename ? if so how
    See more | Go to post

  • cckramer
    replied to search string in a file and print
    in Perl
    code for a simpler example

    Note: This could be the code if the content was one line each and the keyword was enclosed(2nd word in ech line) as part of that line.But what I need is if that key word is separate line as mentioned in the original question and there is more than one line below the keyword.

    Code:
    ## assuming below is how file1.txt looks like ## 
    ## For Indicators, please visit b.x.com.
    ...
    See more | Go to post
    Last edited by numberwhun; Dec 10 '08, 12:38 AM. Reason: Please use code tags.

    Leave a comment:


  • cckramer
    started a topic search string in a file and print
    in Perl

    search string in a file and print

    Hi,

    I have a file which has contents like this :

    Indicators :

    for issues with indicators contact a@x.com

    for access to indicators contact b@x.com

    Unix_Versions :

    for latest unix versions check out u.versions.com/new.html

    for past versions please see u.versions.com/old.html

    -----------------

    The keywords are...
    See more | Go to post
No activity results to display
Show More
Working...