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 strongm 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. Triton46

    Loop

    No, you can do a loop in the batch code but not in the job itself.
  2. Triton46

    printf awk sed to retrieve data

    linmatty/all Thanks! I kinda figured out what is going on. Sometime after the creation of the msg$$ file there is an additional line of data put into it from vmstat. If I stop the program at a certain point I can see two lines of numbers. I'm not sure if that is normal for vmstat or if it...
  3. Triton46

    printf awk sed to retrieve data

    linmatty, It does print a header, but that header exists in the static file as well. I only get double the output from the second script (note the sections that were commented have been uncommented and instead of looking at msg.txt it is reading msg$$ which is created by vmstats).
  4. Triton46

    printf awk sed to retrieve data

    Final problem. These scripts work for a static file, but for some reason the script returns different values when sending vmstats to a file. Here is the entire script with output depending on what is commented out: #!/bin/ksh ORACLE_HOME=/tpsw/app/oracle/product/8.1.7 SERVER_NAME=`uname...
  5. Triton46

    printf awk sed to retrieve data

    Test1: #!/bin/ksh sed -e '1,2d' -e 's/^[ ]*//g' /tmp/sample.txt | nawk -F '[ ][ ]*' ' {printf("%d %d %d %d %d %d %d\n", $1, $8, $9, $14, $15, $16, $17)}' | while read RUNQUE PAGE_IN PAGE_OUT USER_CPU SYSTEM_CPU IDLE_CPU WAIT_CPU garbage do echo ${RUNQUE} echo ${PAGE_IN}...
  6. Triton46

    printf awk sed to retrieve data

    vgersh99, I tried the read at the end when I first put the program together and it would not read. Moving it to the beginning got it to work correctly. I'll copy and paste your script into unix and try again. linmatty, I'll try yours too.
  7. Triton46

    printf awk sed to retrieve data

    Ok, I just noticed that the file had tmp/msg* msg* being the key here. It was reading all the msg files in tmp (which there were a few). I reran: while read name1 name2 name3 do echo 'start second loop' sed -e '1,4d' -e 's/^[ ]*//g' /tmp/msg18145 | nawk -F '[ ][ ]*' ' {printf("%d %d...
  8. Triton46

    printf awk sed to retrieve data

    vgersh99, the command reproduces a line of data, but I want to put parts of that line ($1, $8, $9, $14, $15, $16, $17) into variable for inserting (echoing in my example) into a table. I am anticipating having the data from 'column' 1, 'column' 8, 'column' 9, etc in variables name1, name2...
  9. Triton46

    printf awk sed to retrieve data

    linmatty, It really has nothing to do with oracle, I am just reading in some server stats from a file that is updated constantly on the oracle server. The file is three rows long with several 'columns' of data on server statistics. The last run I used this script: while read name1 name2...
  10. Triton46

    printf awk sed to retrieve data

    sample msg file: procs memory page disk faults cpu r b w swap free re mf pi po fr de sr m0 m1 m3 m4 in sy cs us sy id 0 0 0 18288 5744 4 114 67 7 2265 0 3809 0 0 0 0 633 2656 1218 18 12 70 *note there are only three rows, the one...
  11. Triton46

    printf awk sed to retrieve data

    Getting closer. The latest results: 0 114 66 0 0 0 0 0 0 0 114 66 0 0 0 0 0 0 0 114 66 0 0 0 0 0 0 0 114 67 0 0 0 0 0 0 0 114 67 0 0 0 0 0 0 0 114 67 0 0 0 0 0 0 0 114 67 0 0 0 0 0 0 0 114 67 0 0 0 0 0 0 0 114 67 0 0 0 0 0 0 0 114 67 0 0 0 0 0 0 0 114 67 0 0 0 3 0 0 10055096 60800 1 0 0 3 2188...
  12. Triton46

    printf awk sed to retrieve data

    while read name1 name2 name3 do echo 'start second loop' cat /tmp/msg$$ | sed 1,2d | awk '{print $7 " " $8 " " $17}' echo $name1 echo $name2 echo $name3 Here is the latest output: 114 67 633 2 1453 747...
  13. Triton46

    printf awk sed to retrieve data

    linmatty, I need the loop to do an insert into from the file to a table. That part works. :) But this sed/awk/print/printf business is spitting out the wrong stuff.
  14. Triton46

    printf awk sed to retrieve data

    Let me past the entire while loop: while read RUNQUEPAGE_IN PAGE_OUT USER_CPU SYSTEM_CPUIDLE_CPU WAIT_CPU do echo 'start second loop' cat /tmp/msg$$ | sed 1,4d | nawk -F &quot;[ ][ ]*&quot; '{ print $1 $8 $9 $14 $15 $16 $17 }' #$ORACLE_HOME/bin/sqlplus xxx/xxx@xxx<<EOF # insert into...
  15. Triton46

    printf awk sed to retrieve data

    Can you be more specific here?
  16. Triton46

    printf awk sed to retrieve data

    Yeah, but this is what I get weather I use printf or print , devcix memory page faults cpu The spaces represent nulls but you can see what it is grabbing. It does this three times for the different lines. , devcix b w free re mf pi po fr de sr m0 m1 m3 m4 in sy cs us sy id Then...
  17. Triton46

    printf awk sed to retrieve data

    I'm trying to grab the value at 1, 8, 9, etc. I'm using this script from a DBA tuning sight: http://oracle.oreilly.com/news/unix_oracle_0101.html This part confuses me as I am not a Unix guru. Even the way he defines it does not seem to work (as the man pages define it). The output I get...
  18. Triton46

    printf awk sed to retrieve data

    I have a file that looks like: procs memory page disk faults cpu r b w swap free re mf pi po fr de sr m0 m1 m3 m4 in sy cs us sy id 0 0 0 1888 776 4 109 65 6 2277 0 3771 0 0 0 0 625 2371 1162 16 12 72 It was built from vmstat for...
  19. Triton46

    Accessing Common Dialog

    *Note on Trick2 In version 6.5.2.0, Quickview will NOT recognize ExecuteBScript but Insight and Designer will. Brio no longer supports ExecuteBScript.
  20. Triton46

    Union and Intersect

    I found that, however it is not available for the version we are using (6.2.2.53). Thanks!

Part and Inventory Search

Back
Top