Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. stevenawk

    user entered filename in a different directory

    Yes ! i did tinker with file paths - and it does need the whole path from the top, down. many thanks, S.
  2. stevenawk

    user entered filename in a different directory

    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...
  3. stevenawk

    AWK write file to different directory

    Hi thanks again Feherke, i did try your wrong combo, but i have never even heard of brackets around it! cheers Steve
  4. stevenawk

    AWK write file to different directory

    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 #...
  5. stevenawk

    AWK, Log file dates, &lt;= &amp;&amp; &gt;=

    Thanks PHV, adding that high 9 forces it to include everything below it. ta ! S.
  6. stevenawk

    AWK, Log file dates, &lt;= &amp;&amp; &gt;=

    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'...
  7. stevenawk

    AWK. Read file, create file using field $2 as the name.

    Thanks a lot feherke, we had to adjust a bit as our requirements changed. thanks, S.
  8. stevenawk

    AWK. Read file, create file using field $2 as the name.

    That was quick! Would you mind breaking this down into an explanation please? Other solutions are also still welcome :-) Steve
  9. stevenawk

    AWK. Read file, create file using field $2 as the name.

    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}...

Part and Inventory Search

Back
Top