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 Oracle. Out of this file I want to grab only certain parts to be inserted into a table. I have tried the following:
while read RUNQUEPAGE_IN PAGE_OUT USER_CPU SYSTEM_CPUIDLE_CPU WAIT_CPU
do
cat /tmp/msg$$|sed 1,4d | awk '{ printf("%s %s %s %s %s %s %s\n", $1, $8, $9, $14, $15, $16, $17)}'
Do I need a '%s' for every column in the file? Is there a simple way to retrieve certain columns from this 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 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 Oracle. Out of this file I want to grab only certain parts to be inserted into a table. I have tried the following:
while read RUNQUEPAGE_IN PAGE_OUT USER_CPU SYSTEM_CPUIDLE_CPU WAIT_CPU
do
cat /tmp/msg$$|sed 1,4d | awk '{ printf("%s %s %s %s %s %s %s\n", $1, $8, $9, $14, $15, $16, $17)}'
Do I need a '%s' for every column in the file? Is there a simple way to retrieve certain columns from this file?