Search Results

Search: Posts Made By: rangarasan
951
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...
1,676
Posted By rangarasan
gsub
Hint: gsub

sub() awk function replaces the first occurrences of the string.

gsub() awk function replaces all the occurrences of the string.

Cheers!
Ranga
648
Posted By rangarasan
Tim, How about this? #!...
Tim,

How about this?


#! /usr/bin/perl

use strict;
use warnings;

my $file = 'input_file'; ## Change you input file name
my %info = ();
my %ports = ();

if(open(IFILE, "<", $file)) {...
Forum: What is on Your Mind? 12-31-2015
970
Posted By rangarasan
Happy new year 2016 !!!! Have a great year ahead...
Happy new year 2016 !!!! Have a great year ahead !!!!

Cheers!
Ranga :)
7,393
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,...
1,509
Posted By rangarasan
How about bash? cadena="cual es mi largo"...
How about bash?


cadena="cual es mi largo"
echo "cadena : ${#cadena}"


-Ranga
8,047
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' ") ;

...
728
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
845
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,...
1,094
Posted By rangarasan
Well, How about this? awk...
Well, How about this?


awk '/source/{file=$3".txt";next;}!/END/{print $0 >>file}' input_split.txt


-Ranga
636
Posted By rangarasan
Well, try sed -r 's#\.\.(/\.\.)*#%HOME%#'...
Well, try


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


-Ranga
815
Posted By rangarasan
Just a thought!!! Why you need to use...
Just a thought!!!

Why you need to use substr, match.. etc?


awk -F'<String>|</String>' '/<Node/{for(i=2;i<=NF;i+=2) print $i;}' file_name


-Ranga
1,020
Posted By rangarasan
In bash, pipefail option will do the trick. ...
In bash, pipefail option will do the trick.

Set the pipefail option in top of your bash script.

set -o pipefail

-Ranga
582
Posted By rangarasan
My Bad, Typo..
My Bad, Typo..
582
Posted By rangarasan
Hello, This should add text to beginning of...
Hello,

This should add text to beginning of the variable.


VAR="data" $VAR


Cheers!
Ranga
689
Posted By rangarasan
Getting junk data from MS SQL Server 2008 R2 using PHP 5.3.16
Hey!!!

I am just trying to connect MS SQL Server 2008 R2 from PHP Version 5.3.16 using IIS 7.0.

I am able to connect my MS Sql Server but I am getting junk data eventhough there is a valid...
571
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";
3,382
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;}'...
562
Posted By rangarasan
sed
Hey!!!

Please use code tags for data samples and codes.

Try sth like,


sed -i.bak 's/\(\/[^/]*\/[^/]*\)\1/\1/g' file_name


Here this command will work for your requirement like...
4,888
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
1,742
Posted By rangarasan
Just try the above code :) Cheers!!! -R
Just try the above code :)

Cheers!!!
-R
3,254
Posted By rangarasan
Hey, If you want to take the fourth part of...
Hey,

If you want to take the fourth part of file name, you could do something like below,


ls pay*|awk -F':' '{print $4;}'


If you want to store the output of awk to a variable, you should...
1,063
Posted By rangarasan
grep
Hey,

Try sth like this,

If your grep supports -o option, It will give you first 6 characters of the string.


echo 'abcdefghij'|grep -o '^.\{6\}'

Cheers!!
-R
1,091
Posted By rangarasan
find
Hey,

You could use the find command's mtime option to accomplish this task.


find /target/directory/ -type f -mtime -1 -exec ls -ltr {} \;


Cheers!!!
-R
11,049
Posted By rangarasan
SFTP: Connection problem
HI,
I have generated public key and placed in remote server. When I am trying to do SFTP for that remote server the below error I am getting. Please help me to resolve

Connecting to hostname......
Showing results 1 to 25 of 493

 

Featured Tech Videos

All times are GMT -4. The time now is 11:41 PM.
Unix & Linux Forums Content Copyright 1993-2019. All Rights Reserved.
Privacy Policy