Search Results

Search: Posts Made By: rangarasan
2,589
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...
6,081
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
1,171
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
2,456
Posted By rangarasan
Happy new year 2016 !!!! Have a great year ahead...
Happy new year 2016 !!!! Have a great year ahead !!!!

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


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


-Ranga
17,906
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' ") ;

...
2,244
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,972
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,...
4,307
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
1,638
Posted By rangarasan
Well, try sed -r 's#\.\.(/\.\.)*#%HOME%#'...
Well, try


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


-Ranga
1,818
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,932
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
1,542
Posted By rangarasan
My Bad, Typo..
My Bad, Typo..
1,542
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
1,102
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...
1,091
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";
8,916
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;}'...
1,132
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...
7,827
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
3,557
Posted By rangarasan
Just try the above code :) Cheers!!! -R
Just try the above code :)

Cheers!!!
-R
6,305
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,716
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
2,653
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
20,837
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

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