Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sort on first two fields -only- Post 302362740 by ce3c on Saturday 17th of October 2009 08:38:06 AM
Old 10-17-2009
You're my hero! ^^
You too Scrutinizer Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sort fields

I have a large csv file that looks like this: 14 ,M0081,+000000001,200302,+00000100500, 14 ,M0081,+000000004,200301,+00000100500, 14 ,M0081,+000000005,200305,+00000100500, 14 ,M0081,+000000000,200205,+00000100500, 14 ,M0081,+000000008,200204,+00000100500, ... (2 Replies)
Discussion started by: edog
2 Replies

2. Shell Programming and Scripting

sort sum fields

HI ALL, i have a problem when i do a sort sum with many fields. Is there a limit for fields? Do you know a solution? thanks in advance. the shell is: # SORT1 SORT1_rcode=777 if ; then echo "USE $DARSEQ/OTPU.FTPEPREC RECORD F,1000 " > $DARPARSRT/TPEKL508.SORT1_$$.srt ... (6 Replies)
Discussion started by: tullo
6 Replies

3. Shell Programming and Scripting

sort on fields

Hi I have following fixed width file and I have to sort on 2 fields ABC 111222333002555 77788 ABC 111222333004555 77788 ABC 111222333001555 77788 ABC 111222333003555 77788 ABC 111222333005555 77788 one is from field1 to field 3 "ABC" and another is on 14 to 16 "002" (based on first... (1 Reply)
Discussion started by: mgirinath
1 Replies

4. Shell Programming and Scripting

Sort complicated two fields

Hi experts, I am trying sort command with my data but still not getting the expected results. For example, I have 5 fields data here c,18:12:45,c,c,c d,12:34:34,d,d,d a,13:50:10,a,a,a b,13:50:50,b,b,b a,13:50:50,a,a,a b,14:10:01,b,b,b c,10:12:45,c,c,c I want to get ... (3 Replies)
Discussion started by: lalelle
3 Replies

5. UNIX for Dummies Questions & Answers

sort on three fields

Hi I would like to sort a csv file. It has 50 fields and approx 1400000 lines. I want to sort by three columns as follows. Say sort on coulmn 5, if entries are equal sort on column 3 if this is also equal sort on column 6. It seems that this is possible for 5 then 3 i.e. sort -t "," -k 5,5 -k... (1 Reply)
Discussion started by: turquoise_man
1 Replies

6. Shell Programming and Scripting

Unique sort with two fields

I have a file with contents below 123,502 123,506 123,702 234,101 235,104 456,104 456,100 i want to sort such that i get a unique value in column A, and for those with multiple value in A, i want the lowest value in B. output should be 123,502 234,101 235,104 456,100 (3 Replies)
Discussion started by: dealerso
3 Replies

7. Shell Programming and Scripting

Unique sort with three fields

I have another file with three columns A,B,C as below 123,1,502 123,2,506 123,3,702 234,4,101 235,5,104 456,6,104 456,7,100 i want to sort such that i get a unique value in column A, and for those with multiple value in A, i want the lowest value in C. output should be Code:... (3 Replies)
Discussion started by: dealerso
3 Replies

8. Shell Programming and Scripting

doing a sort on first two fields

hi, i'm having a file stg_ff.txt which contains 10 fields,which contains millions of records i need to cat the first 10 rows in the file after doing a sorting on the first two fields i n the file. can any body help me on this. regards Angel (4 Replies)
Discussion started by: angel12345
4 Replies

9. Shell Programming and Scripting

Sort on first fields only

Please advice in this. Input file 100,vvvt 201,unb 100,sos 301,abc 99,gang desired output 99,gang 100,vvvt 100,sos 201,unb 301,abc Means if first fields are same ( here 100) the do not sort. (4 Replies)
Discussion started by: theshashi
4 Replies

10. Shell Programming and Scripting

awk sort based on difference of fields and print all fields

Hi I have a file as below <field1> <field2> <field3> ... <field_num1> <field_num2> Trying to sort based on difference of <field_num1> and <field_num2> in desceding order and print all fields. I tried this and it doesn't sort on the difference field .. Appreciate your help. cat... (9 Replies)
Discussion started by: newstart
9 Replies
pods::SDLx::Surface(3pm)				User Contributed Perl Documentation				  pods::SDLx::Surface(3pm)

NAME
SDLx::Surface - Graphic surface matrix extension CATEGORY
Extension SYNOPSIS
use SDL; use SDL::Video; use SDLx::Surface; # Create the main surface (display) SDL::init(SDL_INIT_VIDEO); my $display = SDL::Video::set_video_mode(640, 480, 16, SDL_SWSURFACE); my $surf_matrix = SDLx::Surface->new( surface => $display); $surf_matrix->[10][10] = 0xFFFF; #for 16bpp write white at x = 10 and y=10 $surf_matrix->surface( $new_surface ); my $orig_surface = $surf_matrix->surface(); DESCRIPTION
An "SDLx::Surface" allows matrix read and write to a surface, safely. CONSTRUCTOR
new Takes a SDL::Surface in hash format. If a surface is passed to 'surface =>' that is loaded. Otherwise you can define at least a width and a height. SDLx::Surface->new( surface => $surface) # The $surface is loaded SDLx::Surface->new( width=> 400, height=>200) # A SDL::Surface->new( SDL_ANYFORMAT, 400, 200, 32) is loaded SDLx::Surface->new( width=> 400, height=>200, flags=> SDL_SWSURFACE, depth=>24 ) # A SDL::Surface->new( SDL_SWSURFACE, 400, 200, 24) is loaded SDLx::Surface->new( width=> 400, height=>200, flags=> SDL_SWSURFACE, depth=>32, greenmask=>0xFF000000 ) # A SDL::Surface->new( SDL_ANYFORMAT, 400, 200, 32, 0, 0xFF000000,0, 0, 0 ) is loaded SDLx::Surface->new( w => 1, h => 1, color => 0xFF0000FF ) # A SDL::Surface->new( SDL_ANYFORMAT, 1, 1, 32, 0, 0, 0, 0 ) is loaded all pixels are colored with color (red) display If SDLx::App::new or SDL::Video::get_video_mode called before then: my $appx = SDLx::Surface::display(); gets the display if it is already made. Passed options are ignored. Otherwise you can quickly make the display with : SDLx::Surface::display( width => 20, height => 20) #depth => 32 and SDL_ANYFORMAT used or you can also pass flags and depth. SDLx::Surface::display( width => 20, height => 20, flags=> SDL_HWSURFACE, depth=>24) You can also use the keys "w" and "h" in place of "width" and "height", as with "new". Get or create the main display surface and attach to a "SDLx::Surface". duplicate Does a attributes only, no pixel, copy of another SDLx::Surface. ATTRIBUTES
surface If a SDL::Surface is passed it is attached to the matrix. Returns the SDL::Surface that is currently attached to this SDLx::Surface w, h, format, pitch, flags Returns the inner SDL::Surface's respective attribute. See "SDL::Surface". clip_rect Sets the passed "SDL::Rect" as the new clip_rect for the surface. Returns the SDL::Surface's clip_rect. See SDL::Video::get_clip_rect and SDL::Video::set_clip_rect. =head1 EXTENSIONS load my $surface = SDLx::Surface->load( 'hero.png' ); my $surface = SDLx::Surface->load( 'hero.dat', 'bmp' ); Loads the given image file into a new SDLx::Surface surface. A new surface is always created, even if you call it from an already crafted object. Croaks on errors such as no support built for that image extension or a file reading error (the error message is SDL::get_error and should give more details). Note that load() will automatically figure out the extension based on the filename you provide. If you wish to force an extension for whatever reason (like having a filename with a different extension or none at all), you can optionally pass the file type as a second parameter. Case is not relevant. If you don't have SDL_image in your build, only bitmap images will be supported. Returns the new Surface. blit $sdlx_surface->blit( $dest, $src_rect, $dest_rect ); Blits "SDLx::Surface" onto $dest surface. $src_rect or $dest_rect are optional. If $src_rect is omitted, it will be the size of the entire surface. If $dest_rect is omitted, it will be blitted at "(0, 0)". $src_rect or $dest_rect can be array refs or "SDL::Rect". $dest can be "SDLx::Surface" or "SDL::Surface". Note that the final blit rectangle is stored in $dest_rect after clipping is performed. Returns $self blit_by $sdlx_surface->blit_by( $src, $src_rect, $dest_rect ); Does the same as "blit" but the "SDLx::Surface" is the one being blitted to. This is useful when the surface you have isn't an "SDLx::Surface", but the surface it is being blitted to is. Note that the final blit rectangle is stored in $dest_rect after clipping is performed. flip Applies SDL::Video::flip to the Surface, with error checking. Returns $self update $sdlx_surface->update(); # whole surface is updated $sdlx_surface->update([0,0,1,1]); # only that area (0,0,1,1) is updated $sdlx_surface->update( [ SDL::Rect->new(0,0,1,2) ... ]); # defined rects are updated Applies SDL::Video::update_rect for no rect or 1 array ref. Applies SDL::Video::update_rects for array of SDL::Rects. Returns $self draw_rect $sdlx_surface->draw_rect( [$x,$y,$w,$h], 0xFFFF00FF ); $sdlx_surface->draw_rect( SDL::Rect->new($x,$y,$w,$h), 0xFFFF00FF ); Draws a rect on the surface with the given color. If the rect is omitted, the colored rect will be drawn to the entire surface. Returns $self draw_line $sdlx_surface->draw_line( [$x1, $y1], [$x2, $y2], $color, $antialias); # $color is a number $sdlx_surface->draw_line( [$x1, $y1], [$x2, $y2], @color, $antialias); # Draws a line on the surface. Antialias is turned on if $antialias is true. Returns $self draw_circle $sdlx_surface->draw_circle( [$x1, $y1], $radius, @color, $antialias ); Draws an unfilled circle at "($x1,$y1)" of size $radius and $color. Antialias is turned on if $antialias is true. Returns $self draw_circle_filled $sdlx_surface->draw_circle_filled( [$x1, $y1], $radius, @color ); Draws an filled circle at "($x1,$y1)" of size $radius and $color. Antialias is turned on automatically. Returns $self draw_trigon $sdlx_surface->draw_trigon( [ [$x1, $y1], [$x2, $y2], [$x3, y3] ], @color, $antialias ); Draws an unfilled trigon (triangle) with vertices "($x1,$y1)", "($x2,$y2)", "($x3,$y3)" and $color. Antialias is turned on if $antialias is true. Returns $self draw_trigon_filled $sdlx_surface->draw_trigon_filled( [ [$x1, $y1], [$x2, $y2], [$x3, y3] ], @color ); Draws an filled trigon (triangle) with vertices "($x1,$y1)", "($x2,$y2)", "($x3,$y3)" and $color. Antialias is turned on automatically. Returns $self draw_polygon $sdlx_surface->draw_polygon( [ [$x1, $y1], [$x2, $y2], [$x3, y3], ... ], @color, $antialias ); Draws an unfilled polygon with vertices "($xN,$yN)" and $color. Antialias is turned on if $antialias is true. Returns $self draw_polygon_filled $sdlx_surface->draw_polygon_filled( [ [$x1, $y1], [$x2, $y2], [$x3, y3], ... ], @color ); Draws an filled polygon with vertices "($xN,$yN)" and $color. Antialias is turned on automatically. Returns $self draw_arc $sdlx_surface->draw_arc( [ $x, $y ], $radius, $start, $end, $color ); Draws an arc around "($x,$y)" with $radius, $start radius, $end radius and $color. Returns $self draw_ellipse $sdlx_surface->draw_ellipse( [ $x, $y ], $rx, $ry, $color ); Draws an unfilled ellipse centered at "($x,$y)" with horizontal radius $rx, vertical radius $ry and $color. Antialias is turned on if $antialias is true. Returns $self draw_ellipse_filled $sdlx_surface->draw_ellipse_filled( [ $x, $y ], $rx, $ry, $color ); Draws an filled ellipse centered at "($x,$y)" with horizontal radius $rx, vertical radius $ry and $color. Antialias is turned on automatically. Returns $self draw_bezier $sdlx_surface->draw_bezier( [ [$x1, $y1], [$x2, $y2], [$x3, y3], ... ], $s, $color ); Draws a bezier curve of points "($xN,$yN)" using $s steps for interpolation and $color. Antialias is turned on automatically. Returns $self draw_gfx_text Draw text using gfx (not pretty but fast) at give vector, color. $surf->draw_gfx_text( [0,0], 0xffffffff, "fooo"); $surf->draw_gfx_text( [10,10], [20,20,20,20], "fooo"); You can also set the gfx font but passing a hash reference as shown below. my $f = ''; open( my $FH, '<', 'test/data/5x7.fnt'); binmode ($FH); read($FH, $f, 4096); close ($FH); my $font = {data=>$f, cw => 5, ch => 7}; $surf->draw_gfx_text( [0,0], 0xffffffff, "fooo", $font ); Returns $self AUTHORS
See "AUTHORS" in SDL. perl v5.14.2 2012-05-28 pods::SDLx::Surface(3pm)
All times are GMT -4. The time now is 09:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy