Search Results

Search: Posts Made By: pts2
4,357
Posted By pts2
I had to change the " to a ' to get it to run...
I had to change the " to a ' to get it to run (was that a mistake on my part?), but I now get:

awk '$4 ~ /start/ {in++;next} $4 ~ /bad_trial/ {in=0;next} in{print $1 FS $NF}'...
4,357
Posted By pts2
thanks for that suggestion! When I try that,...
thanks for that suggestion!

When I try that, I get errors:


awk "BEGIN {inside=0} $3 ~ /start/ {inside=1} $3 ~ /bad_trial/ {inside=0} {if (inside==1) {print $1 FS $4}" lamar-Training_5seq.log...
8,237
Posted By pts2
Excellent, thank you for that explanation. ...
Excellent, thank you for that explanation.

If I were to want to include something like that in my script (because I want to do several additional other things as I work through the file), how...
8,237
Posted By pts2
Thanks much for your help. Can you unpack...
Thanks much for your help.

Can you unpack this part for me and explain what it is doing?

{l ? l=l RS $0 : l=$0}

my brain hurts trying to figure out what it does, and why it does it.
8,237
Posted By pts2
Hmmm.. not sure what is best for my purposes. I...
Hmmm.. not sure what is best for my purposes. I think I just need to append.

Basically, I want to go through a log file looking for certain items in specific fields. In column 4, I'm looking for...
8,237
Posted By pts2
I have some awk code that, at one point, does...
I have some awk code that, at one point, does this:

{
if ($4 == "good_trial") {
goodTrialCount++ # increment the goodTrial counter
stuffImKeeping=$0
}

I'm assuming that


...
104,976
Posted By pts2
Nowhere does this say WHY this should be done. ...
Nowhere does this say WHY this should be done. This isn't obvious to dummies, who are presumably the ones you are trying to reach with this.
8,237
Posted By pts2
how do I append new lines to awk variable?
I want to build an array using awk, consisting only of a subset of lines of a file. I know how to have awk assess whether a key phrase is in a particular line, but I can't find anywhere how to then...
4,357
Posted By pts2
using awk iteratively in a script to assign variable values
I have a log file that has certain fields that I want to evaluate, and depending on the value in those fields, I want to put the value of a different field in that line in a particular variable that...
Showing results 1 to 9 of 9

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