Search Results

Search: Posts Made By: kush
827
Posted By rdrtx1
sed '2,$s/./&\n/g' file
sed '2,$s/./&\n/g' file
827
Posted By Scrutinizer
Try: sed '/>/!s/./&\ /g' file or with...
Try:
sed '/>/!s/./&\
/g' file

or with GNU sed:
sed '/>/!s/./&\n/g file
15,193
Posted By drl
Hi. This demonstration code: ...
Hi.

This demonstration code:
#!/usr/bin/env bash

# @(#) s1 Demonstrate separate, transpose, sort, transpose, combine file matrix.

# Utility functions: print-as-echo,...
15,193
Posted By RudiC
Apart from solving above line length problems,...
Apart from solving above line length problems, here's something to start with if the problem doesn't hit system limits:
awk -F"\t" '
NR == 1 {printf "%s", substr ($0, 1, index($0, $5)-1)
...
1,629
Posted By RudiC
Tryawk '{sub (/^\.$/,"GG",$9)}1' file
Tryawk '{sub (/^\.$/,"GG",$9)}1' file
1,629
Posted By junior-helper
Try this (verbose) awk code: awk -F'\t' ' ...
Try this (verbose) awk code:
awk -F'\t' '
NR < 4 { print }
NR > 3 { $9="GG"; print }
' OFS='\t' file
3,558
Posted By Scrutinizer
Another one, which assumes that the x values are...
Another one, which assumes that the x values are in ascending order and it will interpolate and extrapolate if x is beyond the boundaries in file2
awk '
FNR==1 {
next ...
3,558
Posted By vgersh99
.... ' OFMT='%.6f' file2 file
....
' OFMT='%.6f' file2 file
3,558
Posted By Akshay Hegde
Some more way...by sorting... awk ' ...
Some more way...by sorting...

awk '
FNR==NR && FNR >1 {
# Read first file starting from 2nd line
A[$1]=$2
next
}

NR!=1 && FNR==1{
# Reading 2nd...
3,558
Posted By Akshay Hegde
@Kush there was one small bug with index I just...
@Kush there was one small bug with index I just fixed it, use updated code, and cross check from here... Linear Interpolation Equation Formula Calculator...
3,558
Posted By vgersh99
Good stuff, AkshayHedge! One suggestion for the...
Good stuff, AkshayHedge!
One suggestion for the function implementation. If you variables local to the function, declare them as formal in the function declaration. Otherwise their scope is global...
3,558
Posted By rbatte1
I think you want to thank Akshay Hegde really. ...
I think you want to thank Akshay Hegde really. Press the :b:Thanks button at the end of the correct post.

Perhaps you could take out the headers from your file so that it's just the raw data.

...
3,558
Posted By Akshay Hegde
akshay@Aix:~/Desktop$ cat f1 BP CM ...
akshay@Aix:~/Desktop$ cat f1
BP CM
752566 rs3094315
752721 rs3131972
753541 rs2073813
760300 rs11564776
12222222


akshay@Aix:~/Desktop$ cat f2
BP CM
740857 1.984065...
3,558
Posted By rbatte1
Okay, let's try this:-#!/bin/ksh ...
Okay, let's try this:-#!/bin/ksh

interpolate()
{
BP_flag=0
while read BPT CMT
do
if [ $BPT -lt $BP ]
then
BP1=$BPT
CM1=$CMT
elif [ $BP_flag -eq 0 ]
then...
1,128
Posted By vgersh99
awk 'FNR==NR {f1[$1]=$2;next} $1 in f1 {$0=$0 OFS...
awk 'FNR==NR {f1[$1]=$2;next} $1 in f1 {$0=$0 OFS f1[$1]}1' dataset1 dataset2
1,539
Posted By RudiC
Making use of default mechanisms in awk, Makarand...
Making use of default mechanisms in awk, Makarand Dodmis' proposal can be reduced to awk '$2~/^rs/' file
1,539
Posted By Skrynesaver
perl -ne 'print if/^\d+\s+rs/' <filename>
perl -ne 'print if/^\d+\s+rs/' <filename>
1,539
Posted By Makarand Dodmis
tryawk '{if($2 ~ /^rs/) {print $0}}' file
tryawk '{if($2 ~ /^rs/) {print $0}}' file
1,558
Posted By pamu
for checking column 2 and 3. It will remove...
for checking column 2 and 3. It will remove duplicates if both column 2 and 3 matches.

awk '!X[$2,$3]++' file
3,719
Posted By rdcwayx
Put this is a file - testawk.awk { for...
Put this is a file - testawk.awk

{
for (i=1;i<=NF;i++)
{
arr[NR,i]=$i;
if(big <= NF)
big=NF;
}
}

END {
for(i=1;i<=big;i++)
{
for(j=1;j<=NR;j++)
{
...
Showing results 1 to 20 of 20

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