Search Results

Search: Posts Made By: TheTransporter
1,863
Posted By Yoda
awk ' { i = $2 FS $1 ...
awk '
{
i = $2 FS $1
if ( i in A )
{
A[i] += $3
next
}
...
1,531
Posted By DGPickett
Assuming it starts at 50 not 0:nx=0 while...
Assuming it starts at 50 not 0:nx=0

while read n c
do
while (( ( nx += 50 ) != n ))
do
echo $nx 0
done
echo $n $c
done <infile >outfile
1,531
Posted By joeyg
Probably other solutions...
I started with your file as sample50.txt

$ seq 6600 50 7100 | sed 's/$/ 0/g' >sample51.txt

$ cut -d" " -f1 <sample50.txt >sample50a.txt

$ cut -d" " -f1 <sample51.txt >sample51a.txt

$ comm...
1,531
Posted By Corona688
awk 'L { while((L+50) < $1) print L+=50, 0 } {...
awk 'L { while((L+50) < $1) print L+=50, 0 } { L=$1 } 1'
1,714
Posted By Scrutinizer
Use three Array elements to hold on to the last...
Use three Array elements to hold on to the last A,B or W value. The part after the last _ is the designator. Empty fields get stored in a 4th element array[" "], that never gets printed.. Try...
2,404
Posted By Corona688
$ cat matrix.awk BEGIN { I=1; OFS="\t" } ...
$ cat matrix.awk

BEGIN { I=1; OFS="\t" }

NF>1 {
# If we haven't seen this index before, save its order
if(! K[$1])
{
O[I]=$1;
...
1,965
Posted By radoulov
And another one: awk 'END { if ( !( c %...
And another one:

awk 'END {
if ( !( c % l ) && nr != NR )
print n, m
}
{
if ( /^[0-9-]/ ) {
m == "" && m == 0 && m = $1
$1 < m && m = $1
if ( !( ++c % l ) ) {
...
1,965
Posted By bartus11
Don't know if you will consider this nice: awk...
Don't know if you will consider this nice: awk '!((NR-1)%20){n[int((NR-1)/20)]=$0;getline;a[int((NR-2)/20)]=$1}(NR%2){t=$0;getline;if (a[int((NR-2)/20)]>$1)...
1,757
Posted By bartus11
Use full path to the mod9.9 program in your...
Use full path to the mod9.9 program in your script.
3,121
Posted By bartus11
Try this script: #!/usr/bin/perl open...
Try this script: #!/usr/bin/perl
open A,"$ARGV[0]";
open B,"$ARGV[1]";
local $/;
$_=<A>;
while (/^[^_]+_(\w+)([^\t]+\t){5}([^\t]+).*?=+\n/msg){
$h{"$1$3"}=$& if ! $h{"$1$3"};
}
$_=<B>;...
3,121
Posted By bartus11
Try: cat file1 file2 | perl -n0e...
Try: cat file1 file2 | perl -n0e 'while(/.{6}_(FIND\d+).*?========\n/sg){$h{$1}.=$&};print $h{$_} for (sort keys %h)'
3,424
Posted By Franklin52
awk -F"\t" 'NR==1{ for(i=2;i<=27;i++){a[i]=$i};...
awk -F"\t" 'NR==1{ for(i=2;i<=27;i++){a[i]=$i}; next}
{for(i=2;i<=27;i++){print $1, a[i] " = " $i}}' file
0
174,059
Posted By Perderabo
cron and crontab
We have hundreds of threads involving cron and crontab. Rather than creating a post with dozens of links, I thought I'd just write up a tutorial with only a few selected links.

The Basics
...
Showing results 1 to 13 of 13

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