Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Combine Similar Output from the 2nd field w.r.t 1st Field Post 302971997 by RudiC on Thursday 28th of April 2016 04:11:57 AM
Old 04-28-2016
I dont really understand your approach, but this
Code:
awk -F, '{T[$2] = T[$2] FS $1} END {for (t in T) print substr (T[t],2), t}' OFS=: file
HostA,HostB:XYZ
HostC:ABC

will turn your input sample into the desired output (uncertain if you want spaces in it or not).
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

replace a similar field in a file

Hello, I am having a file where I have to replace the port values with the variable I defined. The file is an extract of an xml file: <NameValuePair> <name>Service1</name> <value>tcp:32406</value> </NameValuePair> <NameValuePair> ... (2 Replies)
Discussion started by: chiru_h
2 Replies

2. Shell Programming and Scripting

Sort alpha on 1st field, numerical on 2nd field (sci notation)

I want to sort alphabetically on the first field and sort in descending numerical order on the 2nd field. With a normal "sort -r -n" it does this: abc ||| 5e-05 ||| bla abc ||| 3 ||| ble def ||| 1 ||| abc def ||| 0.2 ||| def As you can see it ignores the fact that 5e-05 is actually 0.00005... (1 Reply)
Discussion started by: FrancoisCN
1 Replies

3. Shell Programming and Scripting

Appending 1st field in a file into 2nd field in another file

Hi, I've internally searched through forums for about 2+ hours. Unfortunately, with no luck. Although I've found some cases close to mine below, but didn't help so much. Actually, I'm in short with time. So I had to post my case. Hoping that you can help. I have 2 files, FILE1 ... (0 Replies)
Discussion started by: amurib
0 Replies

4. Shell Programming and Scripting

Append 1st field from a file into 2nd field of another file

Hi, I've internally searched through forums for about 2+ hours. Unfortunately, with no luck. Although I've found some cases close to mine below, but didn't help so much. Actually, I'm in short with time. So I had to post my case. Hoping that you can help. I have 2 files, FILE1 ... (1 Reply)
Discussion started by: amurib
1 Replies

5. Shell Programming and Scripting

Compare two files Field by field and output the result in another file

Hi Friends, Need Help. I have file1.txt as File1.txt |123|A|7267|Hyder|Cross|Sell|7801 |995|A|7051|2008|Lunar|New|Year|Promotion|7801 |996|A|7022|Q108|Targ|Prospect|&|SSCC|Savings|Promo|7801 |997|A|7182|Q1|Feb-Apr|08|Credit|ITA|PA|SBA|Campaign|7801 File2.txt... (7 Replies)
Discussion started by: i150371485
7 Replies

6. Shell Programming and Scripting

Plz Help. Compare 2 files field by field and get the output in another file.

Hi Freinds, I have 2 files . one is source.txt and second one is target.txt. I want to keep source.txt as baseline and compare target.txt. please find the data in 2 files and Expected output. Source.txt 1|HYD|NAG|TRA|34.5|1234 2|CHE|ESW|DES|36.5|134 3|BAN|MEH|TRA|33.5|234... (5 Replies)
Discussion started by: i150371485
5 Replies

7. UNIX for Dummies Questions & Answers

Combine table field for time

Hi, I have table like usrid Month Date year Time w23da Feb 10 2014 12:42:34 ae3aw Feb 20 2014 12:47:02 zse3q Feb 09 2014 10:02:28 all the five fields are inserted into different columns I want to combine all four (Month,Date,year and Time) and make it... (4 Replies)
Discussion started by: stew
4 Replies

8. Shell Programming and Scripting

Combine identical lines and average the one variable field

I have the following file 299899 chrX_299716_300082 196 78.2903 299991 chrX_299982_300000 18.2538 Tajd:0.745591 FayWu:-0.245701 T2:1.45 299899 chrX_299716_300082 196 78.2903 299991 chrX_299982_300000 18.2538 Tajd:0.745591 FayWu:-0.245701 T2:0.283 311027 chrX_310892_311162 300 91.6452... (2 Replies)
Discussion started by: jfern
2 Replies

9. Shell Programming and Scripting

awk to combine by field and average by another

In the below awk I am trying to combine all matching $4 into a single $5 (up to the -), and count the lines in $6 and average all values in $7. The awk is close but it seems to only be using the last line in the file and skipping all others. The posted input is a sample of the file that is over... (3 Replies)
Discussion started by: cmccabe
3 Replies

10. Shell Programming and Scripting

awk to combine matches and use a field to adjust coordinates in other fields

Trying to output a result that uses the data from file to combine and subtract specific lines. If $4 matches in each line then the last $6 value is added to $2 and that becomes the new$3. Each matching line in combined into one with $1 then the original $2 then the new$3 then $5. For the cases... (4 Replies)
Discussion started by: cmccabe
4 Replies
ICCLINK(1)						      General Commands Manual							ICCLINK(1)

NAME
icclink - little cms device link generator. SYNOPSIS
icclink [options] <profiles> DESCRIPTION
lcms is a standalone CMM engine, which deals with the color management. It implements a fast transformation between ICC profiles. icclink is little cms device link generator. Links two or more profiles into a single devicelink profile. Colorspaces must be paired except Lab/XYZ, that can be interchanged. OPTIONS
-8 Creates 8-bit devicelink. -b Black point compensation. -c <0,1,2,3> Precission (0=LowRes, 1=Normal, 2=Hi-res). [defaults to 1] -d description Description text (quotes can be used). -h <0,1,2,3> Show summary of options and examples. -i profile Input profile (defaults to sRGB). -k <0..400> Ink-limiting in % (CMYK only) -o profile Output devicelink profile. [defaults to 'devicelink.icm'] -t <0,1,2,3> Intent (0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute). -x Creatively, guess deviceclass of resulting profile. Built-in profiles: *Lab -- D50-based CIEL*a*b (PCS) *XYZ -- CIE XYZ (PCS) *sRGB -- sRGB color space *Gray22- Monochrome of Gamma 2.2 *Lin2222- CMYK linearization of gamma 2.2 on each channel EXAMPLES
To create 'devicelink.icm' from a.icc to b.icc: icclink a.icc b.icc To create 'out.icc' from sRGB to cmyk.icc: icclink -o out.icc *sRGB cmyk.icc To create a sRGB input profile working in Lab: icclink -x -o sRGBLab.icc *sRGB *Lab To create a XYZ -> sRGB output profile: icclink -x -o sRGBLab.icc *XYZ *sRGB To create a abstract profile doing softproof for cmyk.icc: icclink -t1 -x -o softproof.icc *Lab cmyk.icc cmyk.icc *Lab To create a 'grayer' sRGB input profile: icclink -x -o grayer.icc *sRGB gray.icc gray.icc *Lab To embed ink limiting into a cmyk output profile: icclink -x -o cmyklimited.icc -k 250 cmyk.icc *Lab NOTES
For suggestions, comments, bug reports etc. send mail to info@littlecms.com. SEE ALSO
jpegicc(1), tifficc(1), icc2ps(1), icctrans(1), wtpt(1) AUTHOR
This manual page was written by Shiju p. Nair <shiju.p@gmail.com>, for the Debian project. September 30, 2004 ICCLINK(1)
All times are GMT -4. The time now is 11:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy