IMO move the external pipeline inside of awk as doing it this way will sort on the data and leave the headers untouched...
Probably due to EAGL€'s insistence on posting extremely long one-liners, you missed that there is also a trailer line being printed. To take care of that you need to add an END clause...
to your awk/gawk script.
This User Gave Thanks to Don Cragun For This Post:
Hello,
I am trying to write a formatted report into a file using .ksh script and awk. Here is the command I am trying to run
echo "before awk" ${SRC_SCHEMA}
echo | awk '{printf "%-20s", ${SRC_SCHEMA} }' >>$REPORT_SQL_NAME
I get the following error
before awk ADW
awk: 0602-562 Field $()... (1 Reply)
I have a output of a command like this.
the command is : bdf|sed '/^e/d'|awk '{print$2/1048576}'
output :
0
0.515625
0.481979
2
2
2
7.8125
4
2
0.488281
7.8125
3.90625
4
1.95312
1
0.488281 (4 Replies)
i have a file and i want to print the second variable and add qoutes to it
i do
awk -F"|" '{print $2}' star.unl.
i get the output xxxxxxx
but i need the variable($2) to be in quotes.like
"xxxxxxx"
how do i do there please (3 Replies)
hi friends,
The code:
i=1
while
do
filename=`/usr/bin/ls -l| awk '{ print $9}'`
echo $filename>>summary.csv
#Gives the name of the file stored at column 9
count=`wc -l $filename | awk '{print $1}'`
echo $count>>summary.csv
#Gives just the count of lines of file "filename"
i=`expr... (1 Reply)
Hallo,
i have a file which looks like this:
$1 $2 $3
Student1 55 Pass
55 Pass
35 Fail
Student2 55 Pass
55 Pass
35 Fail
i want that the $1 field... (3 Replies)
Disclaimer: OP is 100% Awk beginner.
I use this code on ASCII files I need to report against.
awk 'BEGIN {
tokens = 0
tokens = 0
tokens = 0
}
{ for (token in tokens)
{ if ($1 == token){print $0; tokens++;}}}
END {for (token in tokens){
if( tokens ==... (1 Reply)
I'm having a small issue with AWK:
I run this in PUTTY:
awk 'BEGIN{FS=","}NR==FNR{A=$1;next}{if (A==$1) print $0}' FILE1 FILE2 And it gives me the output that I expect.
I wanted to create a file.awk file that i could just run instead of typing this out all the time. But its not giving my... (1 Reply)
I have a strange issue.
(awk '$3 == "nfs" { cnt++ }; END { print cnt }' /etc/fstab)
This is giving different count each time.
To test this, tried the one here
-bash-3.2$ awk '/nfs/{print $2}' /etc/fstab | wc -l
151
-bash-3.2$ awk '/nfs/{print $2}' /etc/fstab | wc -l
145... (6 Replies)
Discussion started by: sureshmsi
6 Replies
LEARN ABOUT OPENSOLARIS
sdl_listmodes
SDL_ListModes(3) SDL API Reference SDL_ListModes(3)NAME
SDL_ListModes - Returns a pointer to an array of available screen dimensions for the given format and video flags
SYNOPSIS
#include "SDL.h"
SDL_Rect **SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
DESCRIPTION
Return a pointer to an array of available screen dimensions for the given format and video flags, sorted largest to smallest. Returns NULL
if there are no dimensions available for a particular format, or -1 if any dimension is okay for the given format.
If format is NULL, the mode list will be for the format returned by SDL_GetVideoInfo()->vfmt. The flag parameter is an OR'd combination of
surface flags. The flags are the same as those used SDL_SetVideoMode and they play a strong role in deciding what modes are valid. For
instance, if you pass SDL_HWSURFACE as a flag only modes that support hardware video surfaces will be returned.
EXAMPLE
SDL_Rect **modes;
int i;
.
.
.
/* Get available fullscreen/hardware modes */
modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
/* Check is there are any modes available */
if(modes == (SDL_Rect **)0){
printf("No modes available!
");
exit(-1);
}
/* Check if or resolution is restricted */
if(modes == (SDL_Rect **)-1){
printf("All resolutions available.
");
}
else{
/* Print valid modes */
printf("Available Modes
");
for(i=0;modes[i];++i)
printf(" %d x %d
", modes[i]->w, modes[i]->h);
}
.
.
SEE ALSO
SDL_SetVideoMode, SDL_GetVideoInfo, SDL_Rect, SDL_PixelFormat
SDL Tue 11 Sep 2001, 23:01 SDL_ListModes(3)