During the latest Windows 10 update the computer locked up. How does one get the PC to boot to the login screen? It wants to drop into setup of the BIOS. Thanks for your time. flogrr
flogrr
Hi Kathy,
Given your example this should do it:
awk '/^[0-9]+/ {
if($3 ~ /yes/) $3 = "abc"
}' infile > outfile
This limits the action to only lines that begin with one or more numbers and tests field 3 for a match on "yes". If so, it replaces "yes" with...
Hi Shaun,
It looks like since you do not use explicit "return" statements in your functions, the AWK language automatically returns the data that was processed by the function call. Therefore, you may simply need to add a "print" immediately after the call to the Unblock...
Hi lambros,
If I understand what you are trying to do correctly, this should work.
I did not use arrays, but captured the data you wanted in substrings
and put it together as one output record.
Using the sample input you provided, this is the output:
(13/Oct/2002:15:22:57 ) : 'lambros' Test...
Hi lambros,
It looks like part of the problem is the reg[0]=$1
AWK does not work the same as 'C' when it comes to arrays.
Try changing the zero to one:
reg[1]=$1
If the error persists, please post some example input and
what the output should look like.
flogrr
flogr@yahoo.com
Hi Vlad!
Thanks for the welcome.
Since 9/11 I have been kept very busy with no sign of relief! I do check on what is going on but cannot spare the time to help out a lot.
However, you folks (Cakiwi, marsd, yourself, and others) have been dealing with some complex awk problems lately and...
Jo-
O.K., this is what you need to do:
#!/bin/sh # Must be run in Bourne Shell
test=$1
When used within nawk it is addressed:
"'$test'" # Have to have double layer of quotes
# to protect var from interpretation
# by the shell
So, just...
Hi jo90,
You may have to enclose in double quotes:
nawk -v var="01/Oct/2002:15:56:55" -f awkscript.awk
You may also have to add backslashes to escape the
forward slashes:
nawk -v var="01\/Oct\/2002:15:56:55" -f awkscript.awk
One or the other should work for you...
Hi erixire,
This will do it but it will leave the field separator
between F1 and F2:
awk '{$1="";print}' input > output
however, NAWK can take care of it with:
nawk 'BEGIN{FS=" "}{$1="";sub(" ","");print}' input > output
To use the nawk...
Hi Kevin!
Simply edit in a control "L" (^L) immediately following the last line of each page.
This will cause the printer to form feed exactly where you want it to!
Hope this helps you.
flogrr
flogr@yahoo.com
Hi cback-
I have tried to solve this for you, but alas, no dice!
However, to understand what is happening, refer to the AWK SUMMARY in APPENDIX A (page 192) of The AWK Programming Language book. Here you will find a lucid description as to why AWK acts this way.
HTH
flogrr...
Hi Dave-
I modified the script by bigoldbulldog and it seems to work. Try it and change things the way you need them.
I tried to set it up to allow some flexibility in how you want to move (mv) files, etc.
/\.00[12]/{
fn = $0
nf = substr(fn,1,length(fn)-4)
while ((getline x < fn) >...
Hi rscotty,
If your first 4 fields can be counted on to be static, then, this should work for you. I tested it on your short snippet of input and it seems to do what you want. I set it up to be comma delimited, of course!
awk 'BEGIN{FS=","}
{
for(i=5;i<=NF;i++)
if($i...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.