Sponsored Content
Top Forums Shell Programming and Scripting Sorting within a record using AWK Post 302557869 by radoulov on Thursday 22nd of September 2011 09:37:08 AM
Old 09-22-2011
Which awk version (which operating system)?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk sorting

Hi, I have used the following code to sort two sets of data: awk '{printf "%10s %s\n",$1,$2}' The first column is text and the second involves numbers. I was just wondering how i would go about sorting the second number so that they ascend from the top? Thanks for any help (4 Replies)
Discussion started by: Jaken
4 Replies

2. Shell Programming and Scripting

sorting in awk

i have following file have following type of data 1~%%~fcashfafh~%%~9797 can i sort(numeric) the file on first field and then on last feild using awk (3 Replies)
Discussion started by: mahabunta
3 Replies

3. Shell Programming and Scripting

AWK, sorting-if and print help.

Little-bit of awk experience, need some of the expert help on here. Browsed around here, got a little further, but I am still missing some pieces. Can you help me fill-in my missing awk cells? Sample data file (leaving out ","'s): Column 1 Column 2 Column 3 Column 4 ... (10 Replies)
Discussion started by: boolean2222
10 Replies

4. Shell Programming and Scripting

Please help in sorting record

dn: uid=peter@exmaple.com,ou=example-com,ou=mail,dc=example,dc=to cn: Peter sn: Norton displayName: Peter Norton dn: uid=ras@exmaple.com,ou=example-com,ou=mail,dc=example,dc=to cn: Ras sn: Kam displayName: Ras Kam i have a text file with 300 entries with multiple ldap entries... (5 Replies)
Discussion started by: learnbash
5 Replies

5. Shell Programming and Scripting

Sorting inside awk

I have an array with five columns and i want to write it to a file. Before writing it i must sort it using the field in the fifth column. _________________________________________ |field 1|field 2|field 3|field 4|field 5| | | | | | | | | | |... (6 Replies)
Discussion started by: beatblaster666
6 Replies

6. Shell Programming and Scripting

Sorting record

Hi all, Can any one help whether we can able to sort a record with delimiter plz ? (3 Replies)
Discussion started by: thelakbe
3 Replies

7. Shell Programming and Scripting

Help with awk sorting with different values

Hello, I have a file as follows: BTA Pos KLD 4 79.7011 5.7711028907 4 79.6231 5.7083918219 5 20.9112 4.5559494707 5 58.0002 3.4423546273 6 38.2569 4.7108176788 6 18.3889 7.3631759258 (1 Reply)
Discussion started by: Homa
1 Replies

8. Shell Programming and Scripting

How to compare current record,with next and previous record in awk without using array?

Hi! all can any one tell me how to compare current record of column with next and previous record in awk without using array my case is like this input.txt 0 32 1 26 2 27 3 34 4 26 5 25 6 24 9 23 0 32 1 28 2 15 3 26 4 24 (7 Replies)
Discussion started by: Dona Clara
7 Replies

9. Shell Programming and Scripting

Require original field position after sorting the values in a record

Dear Team, Can any body help me out to get the filed position of the records post sorting using AWK programming. Thanks in advance Example Input: StudentID col-1 col-2 col-3 col-4 1234 14 10 12 13 1235 10 11 12 13 1236 13 12 11 10 ... (3 Replies)
Discussion started by: Srinivasa Reddy
3 Replies

10. Shell Programming and Scripting

Sorting group of records and loading last record

Hi Everyone, I have below record set. File is fixed widht file 101newjersyus 20150110 101nboston us 20150103 102boston us 20140106 102boston us 20140103 I need to group record based on first 3 letters in our case(101 and 102) and sort last 8 digit in ascending order and print only... (4 Replies)
Discussion started by: patricjemmy6
4 Replies
srec_aomf(5)							File Formats Manual						      srec_aomf(5)

NAME
srec_aomf - Intel Absolute Object Module Format DESCRIPTION
The Absolute Object Module Format (AOMF) is a subset of the 8051 OMF. The structure of an absolute object file (the order of the records in it) is similar to that of a relocatable object file. There are three main differences: the first is that an absolute object file con- tains one module only, the second is that not all the records can appear in the absolute file and the third is that the records can contain only absolute information. Generic Record Format Each record starts with a record type which indicates the type of the record, and record length which contain the number of bytes in the record exclusive of the first two fields. The record ends with a checksum byte which contains the 2s complement of the sum (modulo 256) of all other bytes in the record. Therefore the sum (modulo 256) of all bytes in the record is zero. The record length includes the payload and checksum fields, but excludes the type and length fields. All 16-bit fields are little-endian. +--------+---------+---------+---------+ |REC | Record | Payload | CHK | |TYP | Length | | SUM | |8 bits | 16 bits | | 8 bits | +--------+---------+---------+---------+ Here are some of the relevant record types: 0x01 Scope Definition Record 0x02 Module Start Record 0x04 Module End Record 0x06 Content Record 0x0E Segment Definition Record 0x12 Debug Items Record 0x16 Public Definition Record 0x18 External Definition Record Names are not stored a C strings. Names are stored as a length byte followed by the contents. Structure An AOMF file consists of a module header record (0x02), followed by one or more content (0x06), scope (0x01) or debug (0x12) records, and ends in a module end record (0x04). The records with the following types are extraneous (they may appear in the file but are ignored): 0x0E, 0x16 and 0x18 (definition records). All records which are not part of the AOMF and are not extraneous are considered erroneous. Module Header Record +--------+---------+---------+---------+---------+---------+ | REC | Record | Module | TRN ID | zero | CHK | | TYP | Length | Name | 8 bits | 8 bits | SUM | | 0x02 | 16 bits | | | | 8 bits | +--------+---------+---------+---------+---------+---------+ Each module must starts with a module header record. It is used to identify the module for the RL51 and other future processors of 8051 object files. In addition to the Module Name the record contains: TRN ID The byte identifies the program which has generated this module: 0xFD ASM51 0xFE PL/M-51 0xFF RL51. Module End Record +--------+---------+---------+---------+---------+---------+---------+ | REC | Record | Module | zero | REG | zero | CHK | | TYP | Length | Name | 16 bits | MSK | 8 bits | SUM | | 0x04 | 16 bits | | | 8 bits | | 8 bits | +--------+---------+---------+---------+---------+---------+---------+ The record ends the module sequence and contains the following information: characteristics MODULE NAME The name of the module is given here for a consistency check. It must match the name given in the Module Header Record. REGISTER MASK (REG MSK) The field contains a bit for each of the four register banks. Each bit, when set specifies that the corresponding bank is used by the module: Bit 0 (the least significant bit) bank #0. Bit 1 bank #1. Bit 2 bank #2. Bit 3 bank #3. Content Record +--------+---------+---------+---------+---------+---------+ | REC | Record | SEG ID | Offset | DATA | CHK | | TYP | Length | 8 bits | 16 bits | | SUM | | 0x06 | 16 bits | | | | 8 bits | +--------+---------+---------+---------+---------+---------+ This record provides one or more bytes of contiguous data, from which a portion of a memory image may be constructed. SEG ID This field must be zero. OFFSET Gives the absolute address of the first byte of data in the record, within the CODE address space. DATA A sequence of data bytes to be loaded from OFFSET to OFFSET+RECORDLENGTH-5. Size Multiplier In general, raw binary data will expand in sized by approximately 1.02 times when represented with this format. SOURCE
http://www.intel.com/design/mcs96/swsup/omf96_pi.pdf ftp://download.intel.com/design/mcs51/SWSUP/omf51.exe (zip archive) http://www.elsist.net/WebSite/ftp/various/OMF51EPS.pdf COPYRIGHT
srec_cat version 1.58 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Peter Miller The srec_cat program comes with ABSOLUTELY NO WARRANTY; for details use the 'srec_cat -VERSion License' command. This is free software and you are welcome to redistribute it under certain conditions; for details use the 'srec_cat -VERSion License' command. AUTHOR
Peter Miller E-Mail: pmiller@opensource.org.au //* WWW: http://miller.emu.id.au/pmiller/ Reference Manual SRecord srec_aomf(5)
All times are GMT -4. The time now is 02:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy