Search Results

Search: Posts Made By: Fredrick
9,041
Posted By Scott
atan requires two arguments. atan2(y, x) ...
atan requires two arguments.


atan2(y, x)
This gives you the arctangent of y / x in radians.
4,033
Posted By hanson44
I think some of your expected output is...
I think some of your expected output is incorrect. Anyway, try the following.


$ cat test.awk
NR==1 {split ($0, headers); print; next}
{
x=NF; $11=$12="-"
for (i=2; i<x; i++) {
if ($i > 5...
2,785
Posted By elixir_sinari
What's the expected output? Do you want to...
What's the expected output? Do you want to consider the absolute differences?
2,785
Posted By pamu
Hi I have started with i=2 because, for i=1...
Hi

I have started with i=2 because, for i=1 while subtracting with column 1 its value is never greater than 2.

Try below code..

I have modified file to check the output....


cat file...
2,785
Posted By RudiC
If I got you right, try this:awk '{for...
If I got you right, try this:awk '{for (i=2;i<=NF;i++) if (($i-$1)>2 && $i-$(i-1)>2) print "line ", NR, ", field ", i}' infile
Hey, you're changing targets!
awk '{for (i=2;i<=NF;i++) if (($i-$1)>1...
2,785
Posted By pamu
I think your condition is wrong... Tried...
I think your condition is wrong...

Tried this getting all 0..


awk '{for(i=2; i<=NF; i++) {if ((($i-$1) > 2) && (($(i)-$(i-1) > 2))) print $i; else { print "0" }} }' file
2,785
Posted By RudiC
Welcome, Fredrick, but why don't you phrase your...
Welcome, Fredrick, but why don't you phrase your problem correctly in the first place? This is the third modification now...
awk '{for (i=2;i<=NF;i++)
if (sqrt (($i-$1) * ($i-$1)) >...
7,832
Posted By drl
Hi. Structuring the code and re-writing the...
Hi.

Structuring the code and re-writing the tests:
#!/usr/bin/env sh

# @(#) s1 Demonstrate if structure and tests.

set -o nounset
echo

## Use local command version for the commands in...
2,083
Posted By Klashxx
Something like: awk -F\0 'NF!=1001' infile
Something like:
awk -F\0 'NF!=1001' infile
2,083
Posted By ctsgnb
Could you please provide an example of input and...
Could you please provide an example of input and expected output ?
to print lines that contains at learst one time the number 1 :
grep 1 yourfile
Showing results 1 to 10 of 10

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