Sponsored Content
Full Discussion: Sorting based on columns
Top Forums Shell Programming and Scripting Sorting based on columns Post 302113852 by reborg on Tuesday 10th of April 2007 04:59:38 PM
Old 04-10-2007
Code:
$ echo 'Abc Acc
> Bca Bda Bdd
> Cbc
> Dbc Dca Dda
> Abc Abc Acc
> ' | sort

Abc Abc Acc
Abc Acc
Bca Bda Bdd
Cbc
Dbc Dca Dda

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sorting data based on multi columns

Hi all I have data in following format: CSCH74,2007,1,09103,15 CSCH74,2007,10,09103,0 CSCH74,2007,11,09103,0 CSCH74,2007,12,09103,0 CSCH74,2007,2,09103,15 CSCH74,2007,3,09103,194 CSCH74,2007,4,09103,115 CSCH74,2007,5,09103,66 CSCH74,2007,6,09103,0 CSCH74,2007,7,09103,0... (2 Replies)
Discussion started by: sumeet
2 Replies

2. Shell Programming and Scripting

sorting file based on two or more columns

Hi gang. I'm using a unix/mac system and i'm trying to sort a file (more than 1,000,000 lines). chr1 100000965 100001001 - chr1 100002155 100002191 + chr1 100002165 100002201 + chr1 100002525 100002561 - chr1 10000364 ... (2 Replies)
Discussion started by: labrazil
2 Replies

3. UNIX for Advanced & Expert Users

sorting of varchar columns

Hi , I need to sort a file based on multiple columns All the columns are of varchar type can any one give me the command to sort for varchar columns? Thanks (3 Replies)
Discussion started by: laxmi131
3 Replies

4. Shell Programming and Scripting

Sorting based on Multiple columns

Hi, I have a requirement whereby I have to sort a flat file based on Multiple Columns (similar to ORDER BY Clause of Oracle). I am getting 10 columns in the flat file and I want the file to be sorted on 1st, 3rd, 4th, 7th and 9th columns in ascending order. The flat file is pipe seperated. Any... (15 Replies)
Discussion started by: dharmesht
15 Replies

5. UNIX for Dummies Questions & Answers

Vertical sorting of columns

Please help to sort columns in this file: a b d f c e 1 4 10 16 7 13 2 5 11 17 8 14 3 6 12 18 9 15 I need to sort COLUMNS (so sort command doesn't work) like this: a b c d e f 1 4 7 10 13 16 2 5 8 11 14 17 3 6 9 12 15 18 I know sed can do it but don't know how... :( (7 Replies)
Discussion started by: coppuca
7 Replies

6. Shell Programming and Scripting

Sorting multiple columns

Hi, We have a requirement of need to sort a file based on fields 1,3 and 4. I tried with sort command however it is not giving expected output, can we achieve any other way? Please let me know ASAP. File a e w a a b a a a a d g a a h h c d a e a a a w Output a b a a a a a w a a d... (4 Replies)
Discussion started by: Nagapandi
4 Replies

7. Shell Programming and Scripting

Help in sorting multiple columns

Hello all, I am using printf to print the sorted o/p in my script.I am trying to sort in following way but doesn't work. printf "%13s %2s UDP %15s:%s Program %4s HD: %23s HD: %23s %10s %s %s %3s days %3s hours\n" $encoder $i "${ipaddr}" ${portno} ${progno} ${inres} ${outres} ${inrate}... (4 Replies)
Discussion started by: ramman
4 Replies

8. UNIX for Dummies Questions & Answers

Sorting rows to columns

Dear all, I need your help to sort out a file with more then 15, 000 rows, input file has following format : AT4560 GO:1289GO:8915GO:9243GO:5739GO:6757GO:9245GO:9507output should be like: AT4560 GO:1289 AT4560 GO:8915 AT4560 GO:9243 AT4560 GO:5739 AT4560 GO:6757 AT4560 GO:9245... (5 Replies)
Discussion started by: AAWT
5 Replies

9. Shell Programming and Scripting

Sorting by columns

Hi, I have a tab delimited columnar file where I want to remove lines wherever two particular columns match. so for this file, I want to toss the lines where columns 1 and 2 match: a a 1 3 a b 2 4 b b 3 5 because there are matches column 1 and 2 in lines 1 and 3, I would like a script to... (2 Replies)
Discussion started by: mikey11415
2 Replies

10. Shell Programming and Scripting

Add new columns based on existing columns

Hi all, I am kind of stuck with printing my desired output. Please help me if you know how it can work. My input file(tab separated): NW_0068.1 41,16 100,900 NW_0699.1 4,2,19 200,700,80 My Output file (desired): NW_0068.1 41,16 100,900 100 - 141 NW_0068.1 41,16 100,900 ... (3 Replies)
Discussion started by: sam_2921
3 Replies
wx(3erl)						     Erlang Module Definition							  wx(3erl)

NAME
wx - A port of wxWidgets. DESCRIPTION
A port of wxWidgets . This is the base api of wxWidgets . This module contains functions for starting and stopping the wx-server, as well as other utility func- tions. wxWidgets is object oriented, and not functional. Thus, in wxErlang a module represents a class, and the object created by this class has an own type, wxCLASS(). This module represents the base class, and all other wxMODULE's are sub-classes of this class. Objects of a class are created with wxCLASS:new(...) and destroyed with wxCLASS:destroy(). Member functions are called with wxCLASS:mem- ber(Object, ...) instead of as in C++ Object.member(...). Sub class modules inherit (non static) functions from their parents. The inherited functions are not documented in the sub-classes. This erlang port of wxWidgets tries to be a one-to-one mapping with the original wxWidgets library. Some things are different though, as the optional arguments use property lists and can be in any order. The main difference is the event handling which is different from the original library. See wxEvtHandler . The following classes are implemented directly as erlang types: wxPoint={x,y},wxSize={w,h},wxRect={x,y,w,h},wxColour={r,g,b [,a]}, wxString= unicode:charlist() , wxGBPosition={r,c},wxGB- Span={rs,cs},wxGridCellCoords={r,c}. wxWidgets uses a process specific environment, which is created by wx:new/0 . To be able to use the environment from other processes, call get_env/0 to retrieve the environment and set_env/1 to assign the environment in the other process. Global (classless) functions are located in the wx_misc module. DATA TYPES
colour() : A 3 or 4 tuple: {R,G,B,A} or as argument {R,G,B} is also accepted where each colour channel is a an integer between 0-255. datetime() : {{Year,Month,Day}, {Hour,Minute,Second}} in local timezone. mouseState() : See #wxMouseState{} defined in wx.hrl wxObject() : Opaque object wx_env() : Wx process environment wx_mem() : Wx memory area EXPORTS
new() -> wxObject() Starts a wx server. new(Options::[Option]) -> wxObject() Starts a wx server. Option may be {debug, Level}, see debug/1. destroy() -> ok Stops a wx server. get_env() -> wx_env() Gets this process's current wx environment. Can be sent to other processes to allow them use this process wx environment. See also: set_env/1 . set_env(Wx_env::wx_env()) -> ok Sets the process wx environment, allows this process to use another process wx environment. null() -> wxObject() Returns the null object is_null(Wx_ref::wxObject()) -> boolean() Returns true if object is null, false otherwise getObjectType(Wx_ref::wxObject()) -> atom() Returns the object type typeCast(Old::wxObject(), NewType::atom()) -> wxObject() Casts the object to class NewType. It is needed when using functions like wxWindow:findWindow/2, which returns a generic wxObject type. batch(Fun::function()) -> term() Batches all wx commands used in the fun. Improves performance of the command processing by grabbing the wxWidgets thread so that no event processing will be done before the complete batch of commands is invoked. See also: foldl/3 , foldr/3 , foreach/2 , map/2 . foreach(Fun::function(), List::list()) -> ok Behaves like lists:foreach/2 but batches wx commands. See batch/1 . map(Fun::function(), List::list()) -> list() Behaves like lists:map/2 but batches wx commands. See batch/1 . foldl(Fun::function(), Acc::term(), List::list()) -> term() Behaves like lists:foldl/3 but batches wx commands. See batch/1 . foldr(Fun::function(), Acc::term(), List::list()) -> term() Behaves like lists:foldr/3 but batches wx commands. See batch/1 . create_memory(Size::integer()) -> wx_memory() Creates a memory area (of Size in bytes) which can be used by an external library (i.e. opengl). It is up to the client to keep a reference to this object so it does not get garbage collected by erlang while still in use by the external library. This is far from erlang's intentional usage and can crash the erlang emulator. Use it carefully. get_memory_bin(Wx_mem::wx_memory()) -> binary() Returns the memory area as a binary. retain_memory(Wx_mem::wx_memory()) -> ok Saves the memory from deletion until release_memory/1 is called. If release_memory/1 is not called the memory will not be garbage collected. release_memory(Wx_mem) -> term() debug(Level::term()) -> ok Types Level = none | verbose | trace | driver | [Level] Sets debug level. If debug level is verbose or trace each call is printed on console. If Level is driver each allocated object and deletion is printed on the console. demo() -> ok Starts a wxErlang demo if examples directory exists and is compiled AUTHORS
<> wxErlang 0.98.9 wx(3erl)
All times are GMT -4. The time now is 04:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy