Sponsored Content
Top Forums Shell Programming and Scripting How to find DISTINCT rows and combine in one row? Post 302822327 by OTNA on Monday 17th of June 2013 10:42:21 AM
Old 06-17-2013
How to find DISTINCT rows and combine in one row?

Hi ,


i need to display only one of duplicated values and merged them in one record only when tag started with 3100.2.128.8

Code:
3100.2.97.1=192.168.0.12
3100.2.128.8=418/66/03e9/0044801
3100.2.128.8=418/66/03ea/0044601 
3100.2.128.8=418/66/03e9/0044801
3100.2.128.8=418/66/03ea/0044601
3100.2.128.8=418/66/03e9/0044801
3100.2.128.8=418/66/03ea/0044601
3100.2.128.8=418/66/03e9/0044801
3100.2.19.2=665000911

The Result should be like below

Code:
3100.2.97.1=192.168.0.12
3100.2.128.8=418/66/03e9/0044801 | 418/66/03ea/0044601 
3100.2.19.2=665000911


Last edited by OTNA; 06-17-2013 at 12:10 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

select distinct row from a file

Hi, buddies out there. I have a text file ( only one column ) which I created using vi editor. The file contains duplicate rows and I would like to select distinct rows, how to go on it using unix command: file content = apple apple orange watermelon apple orange Can it be done... (7 Replies)
Discussion started by: merry susana
7 Replies

2. UNIX for Dummies Questions & Answers

how to combine two files together, not by row buy by column

let's say, we have: x1.txt 1 2 3 4 5 6 x2.txt 7 8 9 10 11 12 is there a very simple command like 'cat' that can makes them combine into x3.txt : 1 2 7 8 3 4 9 10 5 6 11 12 Thanks so much for help me with the dummiest questions:o (4 Replies)
Discussion started by: kaixinsjtu
4 Replies

3. Shell Programming and Scripting

To count distinct fields in a row

I have . dat file which contains data in a specific format: 0 3 892 921 342 1 3 921 342 543 2 4 817 562 718 765 3 3 819 562 717 761 i need to compare each field in a row with another field of the same column but different row and cont the... (8 Replies)
Discussion started by: Abhik
8 Replies

4. Shell Programming and Scripting

Combine 2 files by rows

Hi, I have 2 files, each files contain about 1 millions lines and I want to joint them to build the new files which contain each 2 lines of file1 and 1 lines of file2. Newfiles: line1-file1 line2-file1 line1-file2 line3-file1 line4-file1 line2-file2 ..... Could someone help... (8 Replies)
Discussion started by: thinhnguyenfr
8 Replies

5. Shell Programming and Scripting

Find distinct values

Hi, I have two files of the following format file1 chr1:345-456 chr2:123-456 chr2:455-678 chr3:456-789 chr3:444-555 file2 chr1:345-456 chr2:123-456 chr3:456-789 output (2 Replies)
Discussion started by: jacobs.smith
2 Replies

6. Shell Programming and Scripting

Combine rows from two files

I have two files, called "File A" and "File B". File A hdisk120: iprod_0000151 dprod_0000135 iprod_0000148 dprod_0000148 iprod_0000157 iprod_0000155 hdisk118: dprod_0000141 dprod_0000134 dprod_0000155 iprod_0000166 dprod_0000129 lprod_0000017 iprod_0000146 (5 Replies)
Discussion started by: Daniel Gate
5 Replies

7. Shell Programming and Scripting

Select distinct rows in a file by last column

Hi, I have the following file: LOG:015608::ERR:2310:map_spsrec:Invalid parameter LOG:015608::ERR:2471:map_dgdrec:Invalid parameter LOG:015608::ERR:2487:map_nnmrec:Invalid number LOG:015608::ERR:2310:map_nmrec:Invalid number LOG:015608::ERR:2438:map_nmrec:Invalid number As a delimiter I... (2 Replies)
Discussion started by: apenkov
2 Replies

8. Shell Programming and Scripting

Combine rows with awk

I have a file of 100,000 entries that look like: chr1 980547 980667 + chr1:980547-980667 chr1 980728 980848 + chr1:980728-980848 chr1 980793 980913 + chr1:980793-980913 I am trying to reformat them to into 5 columns that are tab delineated: chr1 980547 980667 + ... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. Shell Programming and Scripting

Splitting single row into multiple rows based on for every 10 digits of last field of the row

Hi ALL, We have requirement in a file, i have multiple rows. Example below: Input file rows 01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212 01,1,102319,0,1,80,20,U,1,241,00000059420000006021 I need my output file should be as mentioned below. Last field should split for... (4 Replies)
Discussion started by: kotra
4 Replies

10. UNIX for Beginners Questions & Answers

Combine multi-row cell into a single line

My CSV file looks similar to this example (the K, L, and M are in the same cell as J but each on a new line within that cell): 1, A, B, C, D 2, E, F, G, H 3, I, J N, O, K L M, 4, P, Q, R, S I would like to have it look like this: 1, A,... (6 Replies)
Discussion started by: Kim Ashby
6 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 05:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy