Sponsored Content
Top Forums Shell Programming and Scripting Remove sections based on duplicate first line Post 302931938 by disedorgue on Friday 16th of January 2015 03:50:27 PM
Old 01-16-2015
By default, Record Separator is one '\n' that represent end of line, if RS is set to '\n\n', for awk, one record (line) is terminate by '\n\n'.
With this way, one line is one section.

Regards.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Remove duplicate rows of a file based on a value of a column

Hi, I am processing a file and would like to delete duplicate records as indicated by one of its column. e.g. COL1 COL2 COL3 A 1234 1234 B 3k32 2322 C Xk32 TTT A NEW XX22 B 3k32 ... (7 Replies)
Discussion started by: risk_sly
7 Replies

2. Shell Programming and Scripting

Remove duplicate line detail based on column one data

My input file: AVI.out <detail>named as the RRM .</detail> AVI.out <detail>Contains 1 RRM .</detail> AR0.out <detail>named as the tellurite-resistance.</detail> AWG.out <detail>Contains 2 HTH .</detail> ADV.out <detail>named as the DENR family.</detail> ADV.out ... (10 Replies)
Discussion started by: patrick87
10 Replies

3. UNIX for Dummies Questions & Answers

How to get remove duplicate of a file based on many conditions

Hii Friends.. I have a huge set of data stored in a file.Which is as shown below a.dat: RAO 1869 12 19 0 0 0.00 17.9000 82.3000 10.0 0 0.00 0 3.70 0.00 0.00 0 0.00 3.70 4 NULL LEE 1870 4 11 1 0 0.00 30.0000 99.0000 0.0 0 0.00 0 0.00 0.00 0.00 0 ... (3 Replies)
Discussion started by: reva
3 Replies

4. Shell Programming and Scripting

Remove duplicate lines based on field and sort

I have a csv file that I would like to remove duplicate lines based on field 1 and sort. I don't care about any of the other fields but I still wanna keep there data intact. I was thinking I could do something like this but I have no idea how to print the full line with this. Please show any method... (8 Replies)
Discussion started by: cokedude
8 Replies

5. Shell Programming and Scripting

Remove duplicate based on Group

Hi, How can I remove duplicates from a file based on group on other column? for example: Test1|Test2|Test3|Test4|Test5 Test1|Test6|Test7|Test8|Test5 Test1|Test9|Test10|Test11|Test12 Test1|Test13|Test14|Test15|Test16 Test17|Test18|Test19|Test20|Test21 Test17|Test22|Test23|Test24|Test5 ... (2 Replies)
Discussion started by: yale_work
2 Replies

6. Shell Programming and Scripting

Remove duplicate value based on two field $4 and $5

Hi All, i have input file like below... CA009156;20091003;M;AWBKCA72;123;;CANADIAN WESTERN BANK;EDMONTON;;2300, 10303, JASPER AVENUE;;T5J 3X6;; CA009156;20091003;M;AWBKCA72;321;;CANADIAN WESTERN BANK;EDMONTON;;2300, 10303, JASPER AVENUE;;T5J 3X6;; CA009156;20091003;M;AWBKCA72;231;;CANADIAN... (2 Replies)
Discussion started by: mohan sharma
2 Replies

7. Shell Programming and Scripting

How To Remove Duplicate Based on the Value?

Hi , Some time i got duplicated value in my files , bundle_identifier= B Sometext=ABC bundle_identifier= A bundle_unit=500 Sometext123=ABCD bundle_unit=400 i need to check if there is a duplicated values or not if yes , i need to check if the value is A or B when Bundle_Identified ,... (2 Replies)
Discussion started by: OTNA
2 Replies

8. Shell Programming and Scripting

Remove duplicate entries based on the range

I have file like this: chr start end chr15 99874874 99875874 chr15 99875173 99876173 aa1 chr15 99874923 99875923 chr15 99875173 99876173 aa1 chr15 99874962 99875962 chr15 99875173 99876173 aa1 chr1 ... (7 Replies)
Discussion started by: raj_k
7 Replies

9. Shell Programming and Scripting

Remove duplicate rows based on one column

Dear members, I need to filter a file based on the 8th column (that is id), and does not mather the other columns, because I want just one id (1 line of each id) and remove the duplicates lines based on this id (8th column), and does not matter wich duplicate will be removed. example of my file... (3 Replies)
Discussion started by: clarissab
3 Replies

10. Shell Programming and Scripting

Remove duplicate lines from file based on fields

Dear community, I have to remove duplicate lines from a file contains a very big ammount of rows (milions?) based on 1st and 3rd columns The data are like this: Region 23/11/2014 09:11:36 41752 Medio 23/11/2014 03:11:38 4132 Info 23/11/2014 05:11:09 4323... (2 Replies)
Discussion started by: Lord Spectre
2 Replies
srec_intel16(5) 						File Formats Manual						   srec_intel16(5)

NAME
srec_intel16 - Intel Hexadecimal 16-bit file format specification DESCRIPTION
This format is also known as the INHX16 format. This document describes the hexadecimal object file format for 16-bit microprocessors. This format is very similar to the srec_intel(5) format, except that the addresses are word addresses. The count field is a word count. The hexadecimal representation of binary is coded in ASCII alphanumeric characters. For example, the 8-bit binary value 0011-1111 is 3F in hexadecimal. To code this in ASCII, one 8-bit byte containing the ASCII code for the character '3' (0011-0011 or 0x33) and one 8-bit byte containing the) ASCII code for the character 'F' (0100-0110 or 0x46) are required. For each byte value, the high-order hexadecimal digit is always the first digit of the pair of hexadecimal digits. This representation (ASCII hexadecimal) requires twice as many bytes as the binary representation. A hexadecimal object file is blocked into records, each of which contains the record type, length, memory load address and checksum in addition to the data. There are currently six (6) different types of records that are defined, not all combinations of these records are meaningful, however. The record are: o Data Record o End of File Record o Extended Segment Address Record o Start Segment Address Record o Extended Linear Address Record o Start Linear Address Record General Record Format +-------+--------+--------+--------+--------+--------+ |Record | Record | Load | Record | Data | Check | |Mark | Length | Offset | Type | | sum | +-------+--------+--------+--------+--------+--------+ Record Mark. Each record begins with a Record Mark field containing 0x3A, the ASCII code for the colon (":") character. Record Length Each record has a Record Length field which specifies the number of 16-bit words of information or data which follows the Record Type field of the record. This field is one byte, represented as two hexadecimal characters. The maximum value of the Record Length field is hexadecimal 'FF' or 255. Load Offset Each record has a Load Offset field which specifies the 16-bit starting load offset of the data words, therefore this field is only used for Data Records (if the words are loaded as bytes, the address needs to be doubled). In other records where this field is not used, it should be coded as four ASCII zero characters ("0000" or 0x30303030). This field one 16-bit word, represented as four hexadecimal characters. Record Type Each record has a Record Type field which specifies the record type of this record. The Record Type field is used to interpret the remaining information within the record. This field is one byte, represented as two hexadecimal characters. The encoding for all the current record types are: 0 Data Record 1 End of File Record 5 Execution Start Address Record Data Each record has a variable length Data field, it consists of zero or more 16-bit words encoded as set of 4 hexadecimal digits, most significant digit first. The interpretation of this field depends on the Record Type field. Checksum Each record ends with a Checksum field that contains the ASCII hexadecimal representation of the two's complement of the 8-bit bytes that result from converting each pair of ASCII hexadecimal digits to one byte of binary, from and including the Record Length field to and including the last byte of the Data field. Therefore, the sum of all the ASCII pairs in a record after converting to binary, from the Record Length field to and including the Checksum field, is zero. Data Record (8-, 16- or 32-bit formats) +-------+--------+--------+--------+--------+--------+ |Record | Record | Load | Record | Data | Check | |Mark | Length | Offset | Type | | sum | |(":") | | | | | | +-------+--------+--------+--------+--------+--------+ The Data Record provides a set of hexadecimal digits that represent the ASCII code for data bytes that make up a portion of a memory image. The contents of the individual fields within the record are: Record Mark This field contains 0x3A, the hexadecimal encoding of the ASCII colon (":") character. Record Length The field contains two ASCII hexadecimal digits that specify the number of 16-bit data words in the record. The maximum value is 255 decimal. Load Offset This field contains four ASCII hexadecimal digits representing the word address at which the first word of the data is to be placed. (For an exquivalent bytes address, double it.) Record Type This field contains 0x3030, the hexadecimal encoding of the ASCII character "00", which specifies the record type to be a Data Record. Data This field contains sets of four ASCII hexadecimal digits, one set for each 16-bit data word, most significant digit first. Checksum This field contains the check sum on the Record Length, Load Offset, Record Type, and Data fields. Execution Start Address Record +-------+--------+--------+--------+--------+--------+ |Record | Record | Load | Record | EIP (4 | Check | |Mark | Length | Offset | Type | bytes) | sum | |(":") | (4) | (0) | (5) | | | +-------+--------+--------+--------+--------+--------+ The Execution Start Address Record is used to specify the execution start address for the object file. This is where the loader is to jump to begin execution once the hex load is complete. The Execution Start Address Record can appear anywhere in a hexadecimal object file. If such a record is not present in a hexadecimal object file, a loader is free to assign a default execution start address. The contents of the individual fields within the record are: Record mark This field contains 0x3A, the hexadecimal encoding of the ASCII colon (":") character. Record length The field contains 0x3032, the hexadecimal encoding of the ASCII characters "02", which is the length, in bytes, of the EIP regis- ter content within this record. Load Offset This field contains 0x30303030, the hexadecimal encoding of the ASCII characters "0000", since this field is not used for this record. Record Type This field contains 0x3035, the hexadecimal encoding of the ASCII character "05", which specifies the record type to be a Start Address Record. EIP This field contains eight ASCII hexadecimal digits that specify the address. The field is encoded big-endian (most significant digit first). Checksum This field contains the check sum on the Record length, Load Offset, Record Type, and EIP fields. End of File Record This shall be the last record in the file. +-------+--------+--------+--------+--------+ |Record | Record | Load | Record | Check | |Mark | Length | Offset | Type | sum | |(":") | (0) | (0) | (1) | (0xFF) | +-------+--------+--------+--------+--------+ The End of File Record specifies the end of the hexadecimal object file. The contents of the individual fields within the record are: Record mark This field contains 0x3A, the hexadecimal encoding of the ASCII colon (":") character. Record Length The field contains 0x3030, the hexadecimal encoding of the ASCII characters "00". Since this record does not contain any Data bytes, the length is zero. Load Offset This field contains 0x30303030, the hexadecimal encoding of the ASCII characters "0000", since this field is not used for this record. Record Type This field contains 0x3031, the hexadecimal encoding of the ASCII character "01", which specifies the record type to be an End of File Record. Checksum This field contains the check sum an the Record Length, Load Offset, and Record Type fields. Since all the fields are static, the check sum can also be calculated statically, and the value is 0x4646, the hexadecimal encoding of the ASCII characters "FF". Size Multiplier In general, binary data will expand in sized by approximately 2.3 times when represented with this format. EXAMPLE
Here is an example INHX16 file. It contains the data "Hello, World" to be loaded at address 0. :0700000065486C6C2C6F5720726F646CFF0AA8 :00000001FF 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_intel16(5)
All times are GMT -4. The time now is 01:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy