Search Results

Search: Posts Made By: parthmittal2007
1,771
Posted By bakunin
What have you tried so far and why/how did it...
What have you tried so far and why/how did it fail?

Upon thread O/P posts this information any answer will be moderated!

@parmitthal2007: I don't care if you are wanting us to do your homework...
1,785
Posted By balajesuri
perl -ne '(/<A HREF=\".+?>(.+?)<\/A/) && ($HREF =...
perl -ne '(/<A HREF=\".+?>(.+?)<\/A/) && ($HREF = $1);
(/FONT COLOR=.+?B>(.+?)<\/B/) && ($FONT = $1);
(/center\">(.+?)<\/td/) && ($align = $1);
(/<\/tr>/ && $FONT eq 'Down') && print...
1,785
Posted By itkamaraj
$ nawk -F"[<>]"...
$ nawk -F"[<>]" '/HREF/{a=$5}/FONT/{b=$7;getline;getline;if(b=="Down"){print a,b,$5}}' test.txt
Pan Eligibility Down 1020
NS_Display Note Down 100
3,477
Posted By balajesuri
No. That will never happen. The existing element...
No. That will never happen. The existing element is concatenated with a new string.
For e.g, if a[0] initially had 1 and you do this: a[0] .= 0, then a[0] would now contain 10.
3,477
Posted By balajesuri
$l[($.-1)%4].="$_ " => $. refers to line number....
$l[($.-1)%4].="$_ " => $. refers to line number. ($.-1)%4 would always be either 0, 1, 2 or 3. So, what's happening here is: Each line is appended to the elements of an array in index 0, 1, 2 & 3....
4,051
Posted By rdcwayx
Update the code to check the latest date. awk...
Update the code to check the latest date.
awk '{s=$1 FS $2 FS $3}
NR==FNR{a[s]++;d=$4;gsub(/-/,"",d);max[s]=(max[s]>d)?max[s]:d;if (max[s]==d) b[s]=FNR;next}
FNR==1{print;next}
{if...
4,051
Posted By rdcwayx
awk '{s=$1 FS $2 FS $3} ...
awk '{s=$1 FS $2 FS $3}
NR==FNR{a[s]++;b[s]=FNR;next}
FNR==1{print;next}
{if (a[s]<2)
{print}
else
{print (b[s]==FNR)?$0 "|C":$0 "|D"}}' FS=\|...
1,727
Posted By balajesuri
@parthmittal2007: push (@array, (split...
@parthmittal2007:
push (@array, (split /\|/)[0]) for (<I>);is equivalent to
foreach $x (<I>) {
@y = split /\|/, $x;
push (@array, $y[0]); # Appends @array with value stored in $y[0]
}
1,095
Posted By balajesuri
perl -ne 'if ( /(GREEN)/ ) { print "$1 "; $f = 1...
perl -ne 'if ( /(GREEN)/ ) { print "$1 "; $f = 1 }
if ( /center">([0-9]+?)</ && $f == 1 ) { print "$1\n"; $f = 0 }' inputfile
22,179
Posted By balajesuri
@mnithink: Not sure how your code worked! It...
@mnithink: Not sure how your code worked! It doesn't work for me. Try this: (and please use code tags)
#!/usr/bin/perl
use strict; # Its a good practice not to comment these two pragmas.
use...
2,386
Posted By methyl
Using your example as an example for Shell...
Using your example as an example for Shell purposes. I can't vouch for your sql code as I don't know what you are trying to do (and I don't understand the solidi).
In the commercial world we would...
11,674
Posted By Rksiva
Try the below code, and try to change the...
Try the below code, and try to change the parameter 86400 * no of days to make it desire to the requirement.


my $dir = '/home';
opendir(DIR,$dir) || die "Can't open $dir : $!\n";
my @files =...
11,674
Posted By balajesuri
perl -e...
perl -e 'for(<*>){((stat)[9]<(time-(20*86400)))&&unlink}'
1,675
Posted By Rksiva
Create the body content as a file as below, ...
Create the body content as a file as below,


echo "Hello, this is the test mail" > Inpfile
mailx -s "Hi" r@gmail.com <Inpfile
Forum: Linux 12-29-2011
2,704
Posted By fpmurphy
No need to install Cygwin, UWIN or anything like...
No need to install Cygwin, UWIN or anything like that. Windows 7 Ultimate comes with a full POSIX subsystem called Subsystem for UNIX-based Applications (SUA). You just need to turn it on in the...
Forum: Linux 12-29-2011
2,704
Posted By bitlord
Hi, To do this you need to install a...
Hi,
To do this you need to install a UNIX/Linux like environment on your system. Cygwin (http://www.cygwin.com/) is one such program. I have used this it works, but it is best for interaction with...
3,168
Posted By DukeNuke2
Please read the rules...
Please read the rules (https://www.unix.com/misc.php?do=cfrules), which you agreed to when you registered, if you have not already done so.

Thank You.

The UNIX and Linux Forums.
5,738
Posted By balajesuri
Epoch is a reference point which is set as...
Epoch is a reference point which is set as 01-Jan-1970 00:00:00 on Unix systems. Time in seconds from epoch refers to the number of seconds that has passed since epoch. So, 1324636284 refers to Fri...
5,738
Posted By siva shankar
A small script for the same, echo "Enter...
A small script for the same,

echo "Enter date[MM/DD/YYYY]:"
read datee
day=$(date -d $datee +%u)
num=`expr 7 - $day`
x="date -d '$datee $num days'"
eval $x
num=`expr $day - 1`
x="date -d...
5,738
Posted By vivek d r
here is your code..(I fixed the bug :-) ) ...
here is your code..(I fixed the bug :-) )


datee="01/01/2011"
len=${#datee}
mm=${datee:0:2}
dd=${datee:3:2}
yy=${datee:6:4}
mydate=$(date -d 01/01/2011)
day=$( echo $mydate | awk -F' '...
5,738
Posted By balajesuri
Line 15: Input date is converted into time in...
Line 15: Input date is converted into time in seconds from epoch (epoch on most unix systems is 01-Jan-1970 00:00:00).
Line 16: Localtime returns an array and the 7th element specifies the count of...
5,738
Posted By balajesuri
@vivek_d_r: What would your program print if...
@vivek_d_r: What would your program print if input date is 12/01/2011 in mm/dd/yyyy????

@parthmittal2007: Here's the program you asked for:
#! /usr/bin/perl -w
use strict;
use Time::Local;
...
Showing results 1 to 22 of 22

 
All times are GMT -4. The time now is 12:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy