Search Results

Search: Posts Made By: origamisven
1,217
Posted By origamisven
Thanks a lot, Yoda, can you explain the syntax to...
Thanks a lot, Yoda, can you explain the syntax to me? I don't want to die stupid.
1,217
Posted By origamisven
[awk] find pattern, change next two lines
Hi, hope you can help me... It seems like a straightforward problem, but I haven't had any success so far using my basic scripting and awk "skills":

I need to find a pattern /VEL/ in an input file...
1,729
Posted By origamisven
You guys are awesome, thanks all around... Double...
You guys are awesome, thanks all around... Double entries were not desired, I just left the issue out because I didn't want to cause confusion.

DISTCUT=3.5 by the way, a geometric hydrogen...
1,729
Posted By origamisven
[awk] line by line processing the same file
Hey, not too good at this, so I only managed a clumsy and SLOW solution to my problem that needs a drastic speed up. Any ideas how I write the following in awk only?

Code is supposed to do......
1,455
Posted By origamisven
great idea bartus, thanks... this way it works...
great idea bartus, thanks... this way it works generally for me!

paste file1 file2 | awk -v cut1="$var1" -v cut2="$var2" '{for (i=1;i<=NF/2;i++){if($i<cut1&&$(i+NF/2)>cut2){print...
1,455
Posted By origamisven
cutoffs: cut1=1.00000 cut2=5.00000file1 ...
cutoffs:
cut1=1.00000
cut2=5.00000file1
3.75289 3.72466 3.72257
3.45011 3.43072 3.44495
3.27445 3.25306 3.27761
3.0973 3.06597 3.09548
2.76982 0.55555 2.76169
2.83836 2.80111 2.81722
2.71083...
1,455
Posted By origamisven
[awk] working with two files
Hello guys,
I have little to no experience working with two files in awk and hope you can help me with a problem that may be easy for you to solve...

awk -v cut1="$var1" -v cut2="$var2"...
2,908
Posted By origamisven
Of course, thank you... I guess I need to go home...
Of course, thank you... I guess I need to go home and get some sleep ;)

awk -v X0="$X0" -v Y0="$Y0" -v Z0="$Z0" 'BEGIN{ FIELDWIDTHS = "5 3 7 5 8 8 8" }{if ($7 != "")...
2,908
Posted By origamisven
fieldwidths, printf and calculations with variables
Hello guys,
I have a problem concerning the formatting when performing calculations with variables passed to awk and using fieldwidth definitions and printf.

I have the following code:
awk...
1,678
Posted By origamisven
You're right, it doesn't jive... What I meant to...
You're right, it doesn't jive... What I meant to say is "the cutoff value is successively incremented by the cutoff value". Sorry about that. I got it though, thanks to your pointers...

awk...
1,678
Posted By origamisven
awk - updating variable in if statement
I have another question I am stuck at :wall:

I have a text file with two columns, like so...

2 0.0627279
3 0.0794451
4 0.108705
5 0.137739
6 0.190394
7 0.217407
8 0.241764
9 0.344458
10...
1,762
Posted By origamisven
[Solved] awk calculating between lines
Hey guys, maybe you can help me with this...

I want to read input.dat line by line, while doing a simple calculation between the second column value of the current line and the second column value...
1,454
Posted By origamisven
thanks a bunch! :)
thanks a bunch! :)
1,454
Posted By origamisven
splitting single column values into text and number component
Hey guys, I have a column that consists of string and integer values without a distinctive deliminator, looking like this...

7ASA
14LAL
245FOO
656MOM
87577DAD
...

I want to split the...
1,995
Posted By origamisven
I know my code is clumsy. I'm a novice and need...
I know my code is clumsy. I'm a novice and need stuff done quickly and in a practical way. Thanks a lot for the heads up. The awk solution is wonderful. :b:

(Both solutions work, actually)
1,995
Posted By origamisven
Simple while read line loop question
#!/bin/bash

count=1
while read line
do
if (($count > 4)); then
awk -v var1="$count" '{printf "%3s%8s%11s%11s%11s\n",var1,$2,$3,$4,$5}'
else
echo $line
fi...
3,189
Posted By origamisven
@panyam: yes, basically @yazu: thanks, this...
@panyam: yes, basically

@yazu: thanks, this will probably do it!

I have problems adapting your solution to my problem though. What does this part do?

{ s = s $0 "\n"; getline }

In fact...
3,189
Posted By origamisven
Of course... The text file looks something like...
Of course... The text file looks something like this:

1 ABC
1 ABC
1 ABC
2 SOL
2 SOL
2 SOL
5 ABC
5 ABC
5 ABC
5 ABC
2 SOL
2 SOL
2 SOL
3 SOL
3 SOL
3 SOL
3,189
Posted By origamisven
counting lines containing two column field values with awk
Hello everybody,
I'm trying to count the number of consecutive lines in a text file which have two distinctive column field values. These lines may appear in several line blocks within the file, but...
4,024
Posted By origamisven
awk cross-referencing between two files
I need to make my sloppy, existing code (non awk) more efficient and I seem to be terrible with awk :wall:

I've tried around quite a bit, maybe you guys can conjure up a quick solution...
...
14,831
Posted By origamisven
This was extremely helpful and will certainly...
This was extremely helpful and will certainly improve my scripting attemps in the future. Thanks a bunch.

Just for the sake of some other rookie searching on the same issue, this is the code that...
14,831
Posted By origamisven
speeding up bash script with "while read line"
Hello everybody,
I'm still slowly treading my way into bash scripting (without any prior programming experience) and hence my code is mostly what some might call "creative" if they meant well :D
...
1,916
Posted By origamisven
Thanks a bunch zaxxon
Thanks a bunch zaxxon
1,916
Posted By origamisven
sed is dead
Hello everybody,
I'm new to bash scripting (and scripting in general) but I'm making decent progress in the hands-on solutions I need...
I've encountered a problem that seemed very simple to me at...
Showing results 1 to 24 of 24

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