Sponsored Content
Top Forums Shell Programming and Scripting Gawk / Awk Merge Lines based on Key Post 302466964 by Scrutinizer on Wednesday 27th of October 2010 08:16:28 PM
Old 10-27-2010
True, or rather not sorted, but the lines that have the same labels in $1 need to be consecutive.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Merge files based on key

Hi Friends, Can any one help me with merging these file based on two columns : File1: A|123|99|SAMS B|456|95|GEORGE D|789|85|HOVARD File2: S|123|99|NANcY|6357 S|123|99|GREGRO|83748 A|456|95|HARRY|827|somers S|456|95|ANTONY|546841|RUDOLPH|7263 B|456|95|SMITH|827|BOISE STATE|834... (3 Replies)
Discussion started by: sbasetty
3 Replies

2. Shell Programming and Scripting

Merge two files based on a 3rd key file

Hi, I want to merge the two files based on the key file's columns. The key file: DATE~DATE HOUSE~IN_HOUSE CUST~IN_CUST PRODUCT~PRODUCT ADDRESS~CUST_ADDR BASIS_POINTS~BASIS_POINTS ... The other 2 files are From_file & To_file - The From_file: DATE|date/time|29|9 ... (9 Replies)
Discussion started by: dips_ag
9 Replies

3. Shell Programming and Scripting

Merge file lines based off of keyword

Hello Everyone, I have two files I created in a format similar to the ones found below (character position is important): File 1: 21 Cat Y N S Y Y N N FOUR LEGS TAIL WHISKERS 30 Dog N N 1 Y Y N N FOUR LEGS TAIL 33 Fish Y N 1 Y Y N N FINS 43 CAR Y N S Y Y N N WHEELS DOORS... (7 Replies)
Discussion started by: jl487
7 Replies

4. Shell Programming and Scripting

How to merge lines based off of text?

Hello Everyone, I have two files, similar to the following: File 1: 8010 ITEM01 CODE1 FLAG1 filler filler 7020 OBJECT CODE2 FLAG2 filler 6010 THING1 CODE4 FLAG4 6011 ITEM20 CODE7 FLAG7 File 2 contains: 6020 ITEM01 CODEA FLAGA filler filler filler 7000 OBJECT CODEB... (2 Replies)
Discussion started by: jl487
2 Replies

5. Shell Programming and Scripting

Merge multiple lines in same file with common key using awk

I've been a Unix admin for nearly 30 years and never learned AWK. I've seen several similar posts here, but haven't been able to adapt the answers to my situation. AWK is so damn cryptic! ;) I have a single file with ~900 lines (CSV list). Each line starts with an ID, but with different stuff... (6 Replies)
Discussion started by: protosd
6 Replies

6. Shell Programming and Scripting

Need to merge lines based on pattern

Hi, I have a requirement to merge multiple lines based on search pattern. The search criteria is : it will search for CONSTRAINT and when it found CONSTRAINT, it will merge all lines to 1 line till it founds blank line. For Example: CREATE TABLE "AMS_DISTRIBUTOR_XREF" ( "SOURCE"... (5 Replies)
Discussion started by: satyaatcgi
5 Replies

7. Shell Programming and Scripting

Merge mutiple lines into one based on if the first word is some particular value

Hi, trying to knock something together to create one line entries based on whether the first word on each line matches a particular value. eg. Link,"Name=""Something\something"","Timeout=""1800""", "Target=""\\thing\thing\thing""","State=""ONLINE""",something,... (0 Replies)
Discussion started by: adamdb
0 Replies

8. Shell Programming and Scripting

Merge lines based on match

I am trying to merge two lines to one based on some matching condition. The file is as follows: Matches filter: 'request ', timestamp, <HTTPFlow request=<GET: Matches filter: 'request ', timestamp, <HTTPFlow request=<GET: Matches filter: 'request ', timestamp, <HTTPFlow ... (8 Replies)
Discussion started by: jamie_123
8 Replies

9. UNIX for Dummies Questions & Answers

Merge selective columns from files based on common key

Hi, I am trying to selectively merge two files based on keys reported in the 1st column. File1: #file1-header1 file1-header2 111 qwe rtz uio 198 asd fgh jkl 165 yxc 789 poi uzt rew 89 lkj File2: #file2-header2 file2-header2 165 ghz nko2 ... (2 Replies)
Discussion started by: dovah
2 Replies

10. Shell Programming and Scripting

awk - Merge two files based on one key

Hi, I am struggling with the an awk command to merge two files based on a common key. I want to append the value from File2 ($2) onto the end of File1 where $1 from each file matches - If no match then nothing is apended File1 COL1|COL2|COL3|COL4|COL5|COL6|COL7... (3 Replies)
Discussion started by: Ads89
3 Replies
mime.types(5)							    Apple Inc.							     mime.types(5)

NAME
mime.types - mime type description file for cups DESCRIPTION
The mime.types file defines the recognized file types. Additional file types can be added to mime.types or (preferably) in additional files in the CUPS configuration directory with the extension ".types". Each line in the mime.types file is a comment, blank, or rule line. Comment lines start with the # character. Rule lines start with the MIME type name and are optionally followed by a series of file recognition rules that are used to automatically identify print and web files: super/type rule [ ... ruleN] MIME type names are case-insensitive and are sorted in ascending alphanumeric order for the purposes of matching. See the "TYPE MATCHING AND PRIORITY" section for more information. The rules may be grouped using parenthesis, joined using "+" for a logical AND and "," or whitespace for a logical OR, and negated using "!". RULES
Rules take two forms - a filename extension by itself and functions with test values inside parenthesis. The following functions are avail- able: match("pattern") Pattern match on filename ascii(offset,length) True if bytes are valid printable ASCII (CR, NL, TAB, BS, 32-126) printable(offset,length) True if bytes are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254) priority(number) Specifies the relative priority of this MIME type. The default priority is 100. Larger values have higher priority while smaller val- ues have lower priority. string(offset,"string") True if bytes are identical to string istring(offset,"string") True if a case-insensitive comparison of the bytes is identical char(offset,value) True if byte is identical short(offset,value) True if 16-bit integer is identical int(offset,value) True if 32-bit integer is identical locale("string") True if current locale matches string contains(offset,range,"string") True if the range contains the string STRING CONSTANTS
String constants can be specified inside quotes ("") for strings containing whitespace and angle brackets (<>) for hexadecimal strings. TYPE MATCHING AND PRIORITY
When CUPS needs to determine the MIME type of a given file, it checks every MIME type defined in the .types files. When two types have the same matching rules, the type chosen will depend on the type name and priority, with higher- priority types being used over lower-priority ones. If the types have the same priority, the type names are sorted alphanumerically in ascending order and the first type is chosen. For example, if two types "text/bar" and "text/foo" are defined as matching the extension "doc", normally the type "text/bar" will be cho- sen since its name is alphanumerically smaller than "text/foo". However, if "text/foo" also defines a higher priority than "text/bar", "text/foo" will be chosen instead. SEE ALSO
classes.conf(5), cupsd(8), cupsd.conf(5), mime.convs(5), printers.conf(5), http://localhost:631/help COPYRIGHT
Copyright 2007-2011 by Apple Inc. 16 May 2009 CUPS mime.types(5)
All times are GMT -4. The time now is 01:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy