User Profile

Collapse

Profile Sidebar

Collapse
pnsreee
pnsreee
Last Activity: Oct 20 '09, 05:58 AM
Joined: Apr 21 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • pnsreee
    replied to Long Integer
    in Perl
    Hi,

    when I try to compare the values I am getting the wrong results. The difference between $max and $min is "0"

    Regards
    Pnsree...
    See more | Go to post

    Leave a comment:


  • pnsreee
    started a topic Long Integer
    in Perl

    Long Integer

    Hi All,
    I have the following code,
    [code=perl]
    $min=1234567890 1234567890;
    $max=1234567890 1234567899;
    print "max=$max, min=$min \n";
    if ($min < $max)
    {
    print "Output : ok \n";
    }
    else
    {
    print "Output : not ok \n";
    }
    [/code]
    Output:
    max=1.234567890 12346e+19, min=1.234567890 12346e+19
    Output :...
    See more | Go to post
    Last edited by eWish; Apr 15 '08, 03:06 PM. Reason: Please use code tags

  • pnsreee
    started a topic Script to find Overlapping Time

    Script to find Overlapping Time

    Hi,
    I would like to create "time.sh" script that will be run upon exiting file. In the file each entry has a start time and an end time. I would like the script to check to see if any other entry items fall on top of one another? I imagine this would be some type of looping script, but I've got no idea where to start with this one.

    example file:
    sec_1 10:00 11:12
    sec_2 11:23...
    See more | Go to post

  • pnsreee
    started a topic regular expression to verify weekday string
    in Perl

    regular expression to verify weekday string

    Hi

    I have following strings
    Code:
    Sun:mon:tue
    mon:tue:wed
    mon:wed:mon
    I need to check the string have valid values sun,mon,tue,wed and also check duplicates are there or not

    I have following working code to verify that.

    [CODE=perl]
    push(@value, $+) while $sub_data =~ m{"([^\"\\]*(?:\\.[^\"\\]*)*)":? | ([^:]+):? | : }gx;
    ...
    See more | Go to post
    Last edited by miller; Sep 3 '07, 06:35 PM. Reason: Code Tag and ReFormatting

  • pnsreee
    replied to Testing for String inclusion
    in Perl
    Hi madhubabu

    The following code may give answer to ur question

    [CODE=perl]
    if ($error =~ m/$error1/) {
    print " OK \n";
    }
    [/CODE]

    Regards
    Pnsreee
    See more | Go to post
    Last edited by miller; Jul 31 '07, 07:02 PM. Reason: Code Tag and ReFormatting

    Leave a comment:


  • pnsreee
    started a topic problem in finding matching string
    in Perl

    problem in finding matching string

    Hi All,

    I have the following strings seperated by space . I have to grep for Naveen having two values(Sha or See) in the string.

    1)Naveen Sha reswww
    2)Naveen See rex-www
    3)Naveen See rex.x
    4)Naveen xxxx cccccc
    5)ABBCD See reggg
    I have the following regexp.
    $_ =~ /^Naveen[\s](Sha|See)[\s][.....]+$/

    I want the first three strings...
    See more | Go to post

  • Hi Miller

    Thanks for your replay.

    I tried with this regexp s/.txt/_valid.txt/ in perl but i did not got it ...

    Please tell what $ will do in this regexp

    Regards
    Pnsreee
    See more | Go to post

    Leave a comment:


  • pnsreee
    started a topic find and replace last occurance of letter in string
    in Perl

    find and replace last occurance of letter in string

    Hi all,
    I have a string "Post.lang.tmp. txt" and i have to replase the ".txt" with "_large.txt ".

    Please help me regarding this problem.

    I got it in shell scripting using
    `echo $string | awk -F"/" '{print $NF}' | sed s/.txt/_valid.txt/`

    Regards
    Pnsreee
    See more | Go to post

  • pnsreee
    started a topic Validate date in mm/dd/yy format

    Validate date in mm/dd/yy format

    Hi all

    I have date in mm/dd/yy format. to validate that one i am using cut and validating using if statements.

    But i want regexp.


    Please help me regarding this.
    See more | Go to post
    Last edited by pnsreee; Jun 22 '07, 02:38 PM. Reason: provide information

  • pnsreee
    replied to problem in checking time format
    in Perl
    Hi Paul,
    I am checking the string contain the valid time format or not as given above.
    These strings are inputs to my program . If these string is in valid formate I go further like conversions to GMT,EST,CST.

    Regards
    Naveen.P
    See more | Go to post

    Leave a comment:


  • pnsreee
    started a topic problem in checking time format
    in Perl

    problem in checking time format

    Hi all

    I have a time in this format
    12:00p,1:20A .

    In linux i am using following regexp to check it.
    egrep '[0-9]|[0-2]:(0[0-5]|1[0-9])[paPA]' $time.
    I am trying to achive this in perl.

    Please help me regarding this Issue....

    Regards
    Naveen
    See more | Go to post

  • pnsreee
    replied to parsing CSV File
    in Perl
    Hi Miller

    If i use this expression if the string is "raj,234,,asurt,valol" like this i am getting output like this "raj 234 ,asurt valol".
    using regex i cant distuingeshe between ",,," and ",,".

    Thanks
    Naveen
    See more | Go to post

    Leave a comment:


  • pnsreee
    replied to parsing CSV File
    in Perl
    Hi Miller,
    Thanks for Your replay.
    But I want the output like - ('raj' ',' 'asurt' 'valol') when ever I am giving Input like bellow (raj,,,asurt,va lov)

    Is it possable to get output like that.

    Regards
    Naveen
    See more | Go to post

    Leave a comment:


  • pnsreee
    started a topic parsing CSV File
    in Perl

    parsing CSV File

    Hi all ,

    I have the following string
    "raj,234,,,asur t,valol"
    I am using the following code to parse that line into an array.
    Code:
    push(@value, $+) while $tmp2[2] =~ m{"([^\"\\]*(?:\\.[^\"\\]*)*)",?  |  ([^,]+),?   | , }gx;
    push(@value, undef) if substr($tmp2[2], -1,1) eq ',';
    but I want to take the comma into the array.like "raj...
    See more | Go to post

  • pnsreee
    replied to how can I grep "/" in a string.
    in Perl
    Hi Kevin
    I am doing like this
    But i want only one expression

    $data = "opt/valid/all"
    $data =~ s,/,:,g;
    if ( $data =~ /:/ == 0)
    {
    print " not found \n";
    } else {
    print " found \n "
    }
    Regards
    Naveen...
    See more | Go to post

    Leave a comment:


  • pnsreee
    started a topic how can I grep "/" in a string.
    in Perl

    how can I grep "/" in a string.

    Hi all,

    I have folloeing string. How can I grep the "/".
    "opt/valid/all"

    If the string is like this:"opt:valid :all", I am able to grep ":".

    Please help me regarding this issue.

    Regards
    Naveen.P
    See more | Go to post

  • Hi Miller,
    I got the requried out put.

    Regards
    Naveen.P
    See more | Go to post

    Leave a comment:


  • Hi Miller,

    I got output between 10 to 1000 lines.it is not possiable to moniter all lines on screen at a time.so that im trying to redirect it. If lines are less then 40, then I want to print the output on screen.

    Regards
    Naveen
    See more | Go to post

    Leave a comment:


  • Problem in printing a file created in the same script(redirecting output)

    Hi All,

    I am trying to print a log file created in the same script with the code bellow.
    but Im not getting output on screen.
    The output file is created using rediretion of output.
    Code:
    open(STDOUT, ">flat.log") || die "Can't redirect stdout";
    
    prinf " ----------------------------------------------\n";
    printf " xyz ";
    prinf "
    ...
    See more | Go to post

  • pnsreee
    started a topic how can I check a variable is initialized are not
    in Perl

    how can I check a variable is initialized are not

    Hi All,

    I have a uninitialized variabe $tmp. How can I check if the variable is initialized are not.I want to catech the warning without suppressing it using no warnings qw( uninitialized ). Please tell me how can I do it.

    Code:
    my $tmp;
    my $var;
    $var = "raghu";
    if ( $tmp eq "" )
    {
    if ($tmp ne $var)
    {
            print " XYZ \n";
    }
    ...
    See more | Go to post
No activity results to display
Show More
Working...