Hi,
when I try to compare the values I am getting the wrong results. The difference between $max and $min is "0"
Regards
Pnsree...
User Profile
Collapse
-
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 :... -
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... -
regular expression to verify weekday string
Hi
I have following strings
I need to check the string have valid values sun,mon,tue,wed and also check duplicates are there or notCode:Sun:mon:tue mon:tue:wed mon:wed:mon
I have following working code to verify that.
[CODE=perl]
push(@value, $+) while $sub_data =~ m{"([^\"\\]*(?:\\.[^\"\\]*)*)":? | ([^:]+):? | : }gx;
... -
Hi madhubabu
The following code may give answer to ur question
[CODE=perl]
if ($error =~ m/$error1/) {
print " OK \n";
}
[/CODE]
Regards
PnsreeeLeave a comment:
-
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... -
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
PnsreeeLeave a comment:
-
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 -
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. -
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.PLeave a comment:
-
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 -
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
NaveenLeave a comment:
-
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
NaveenLeave a comment:
-
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.
but I want to take the comma into the array.like "raj...Code:push(@value, $+) while $tmp2[2] =~ m{"([^\"\\]*(?:\\.[^\"\\]*)*)",? | ([^,]+),? | , }gx; push(@value, undef) if substr($tmp2[2], -1,1) eq ','; -
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...Leave a comment:
-
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 -
-
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
NaveenLeave 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 "
-
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"; }
No activity results to display
Show More
Leave a comment: