HI,
AWK program:
echo -n "Enter from date: "
read fromDate
echo -n "Enter to date: "
read toDate
echo -n "Enter log name: "
read log
nawk -v fd="$fromDate" -v td="$toDate" '$0>="[" fd && $0<="[" td "9"' $log
This allows a user to enter a log name, which is then used as the input by the...
Hi,
program:
echo -n "Enter the file to process: "
read inputFile
date
nawk '
/^\[.*\]/ {
id=$3
f=id".txt" # assign f
sub(/{/,"",f) # replace { with nothing, in variable f
sub(/}/,"",f) # replace } with nothing, in variable f
time=$1" "$2 #...
Hi,
test2 contains:
[2008-11-18 13:41:44,478]
[2008-11-14 13:42:44,478]
[2008-11-15 13:43:44,478]
[2008-11-16 13:44:44,478]
[2008-11-17 13:45:44,478]
[2008-11-13 13:46:44,478]
I am trying to pull out lines between 2 dates. So far i have this line:
nawk '$0>="["from && $0<="["to'...
Hi,
I'm on a Java project and we've found ourselves needing the beautiful language of AWK!
Problem:
I am reading through a file, line-by-line which looks like this:
---------------------------
[dataA1] {dataA2}
[dataB1] {dataB2}
[dataC1] (dataC2}
garbageG1
garbageG2
[dataD1] {dataD2}...
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.