Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: rangarasan
1,360
Posted By rangarasan
You are almost done with it. awk ' ...
You are almost done with it.


awk '
NR == FNR {min[$1]=$3; max[$1]=$4; Gene[$1]=$NF; next}
{
for (id in min)
if (min < $2 && $2...
Forum: What is on Your Mind? 12-31-2015
1,219
Posted By rangarasan
Happy new year 2016 !!!! Have a great year ahead...
Happy new year 2016 !!!! Have a great year ahead !!!!

Cheers!
Ranga :)
11,788
Posted By rangarasan
Couple of things, You don't need to use cat to...
Couple of things, You don't need to use cat to pass the file content to awk. It's useless use of cat.

You can specify the single quote to get the shell variable interpolate.


awk -F,...
13,415
Posted By rangarasan
You need to allow the perl interpreter to...
You need to allow the perl interpreter to interpolate perl variables.

Just try this.!


system("wget -q --no-check-certificate -O /tmp/DataFile_$TimeStamp 'https://foobar.com/html' ") ;

...
948
Posted By rangarasan
Well, What have you tried so far? Anyways,...
Well, What have you tried so far?

Anyways, Here it is..

sed 's/^Delete_[0-9]*_//' file_name


-Ranga
1,066
Posted By rangarasan
Hi.. How about dynamic variable assignment. ...
Hi..

How about dynamic variable assignment.


perl -lne 'if(/exec/){$q="";$c=1;$qc++;}if($c){$q = join(" ", $q,...
809
Posted By rangarasan
Well, try sed -r 's#\.\.(/\.\.)*#%HOME%#'...
Well, try


sed -r 's#\.\.(/\.\.)*#%HOME%#' file


-Ranga
685
Posted By rangarasan
Hi,, Try something like this.. ...
Hi,,

Try something like this..



my @allipsfound ;
my %ips = ();
for my $elem (@gatches) {
my ($ip) = split ":",$elem;
$ips{$ip} = 1;
}
print join('\n', sort keys %ips), "\n";
6,725
Posted By rangarasan
sed
Hey,

Try sth like this,


sed 's#<head>\(.*\)</head>#\1#' input_file


In awk, you can specify more than delimiter in -F option or FS variable.


awk -F'[<>\t]' '{print $3,$6;}'...
5,824
Posted By rangarasan
You can use maxdepth option in find command to...
You can use maxdepth option in find command to search in current directory only.

Cheers!
-R
2,382
Posted By rangarasan
Just try the above code :) Cheers!!! -R
Just try the above code :)

Cheers!!!
-R
4,240
Posted By rangarasan
awk
Please use code tag for code and data samples.

Try smth like this.


awk -v ip=$(hostname -i) '/InternetProtocol/{print;getline;ip=">"ip"<";sub(/>.*</,ip);}1' input_file


Cheers!!!
-R
782
Posted By rangarasan
Have shortened a bit. Cheers! -R
Have shortened a bit.

Cheers!
-R
1,188
Posted By rangarasan
Hey!!! Welcome to the Unix and Linux...
Hey!!!

Welcome to the Unix and Linux Forum!!!!

Try someting like this,

First of all, you haven't mentioned, What shell you are using, Here you go with bash.


var=$(sed 's/.*roses \([^...
1,180
Posted By rangarasan
awk
Hey,

Try sth like this,


awk -F'\|' 'FNR==NR{a[$1]= $2"^"$3;next;}a[$2]{split(a[$2],b,"^");$6=b[1];$14=b[2];}1' OFS="|" file1 file2


Cheers,
Ranga:)
2,124
Posted By rangarasan
You have to do some more bit with radoulov's...
You have to do some more bit with radoulov's solution like this.

while read line
do
printf '%s\n' "${line%_*}_"
done <"input_file"


(or)

Try this sed,

sed 's/_[^_]*$/_/' input_file...
3,079
Posted By rangarasan
Please check the output of my command and not the...
Please check the output of my command and not the input file.


# awk -v l="15" '{s="%-"l"s\n";printf(s,$0);}' file|awk '{print length($0);}'
15
15
15


Cheers,
Ranga:)

---------- Post...
3,079
Posted By rangarasan
Hey, Welcome to The UNIX and Linux Forums, ...
Hey,

Welcome to The UNIX and Linux Forums,

Please use code tags for data samples and codes. code tag button look like https://www.unix.com/images/editor/code.png

You should use printf to...
3,782
Posted By rangarasan
awk
Hey,

Try something like this,


awk '/^aa|^dd/{print $1,$4;}' file


Cheers,
Ranga:)
925
Posted By rangarasan
nawk
Hey,

To format the output in nawk, you can use printf,

Here is the sample implementation,


echo 'Input string'|nawk '{printf("%s %20s\n",$1,$2);}'

Ouput:

Input string
...
1,544
Posted By rangarasan
perl
We can use these fetched values in integer expression and we don't have type cast and all in perl.

Cheers,
Ranga:)
1,544
Posted By rangarasan
perl
Hi,

Try this one,


open(FILE,"<","$xml_file_name");


while(<FILE>){
if($_ =~ m/accumId="(269|270)"/) {
my $accumId = $1;
my @inclUnits=split(/ /,$_);
my...
1,608
Posted By rangarasan
awk
Hi,

Try this one,


awk -F, '{a[$1]++;if(v[$1]){v[$1]=v[$1] ORS $0;}else{v[$1]=$0;}} END {for (i in a) if (a[i]>=2) print v[i]}' file



If you want to disply only the duplicated lines,

...
7,634
Posted By rangarasan
You are right dude :)
You are right dude :)
7,634
Posted By rangarasan
Hi dude, I think this is going to be a...
Hi dude,

I think this is going to be a temporary directory space issue.
Check with the below option.


sort -T /tmp/dir ....


Cheers,
Ranga :)
Showing results 1 to 25 of 125

 

Featured Tech Videos

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