Sponsored Content
Full Discussion: Parsing through Awk
Top Forums Shell Programming and Scripting Parsing through Awk Post 302501553 by Chubler_XL on Thursday 3rd of March 2011 10:43:24 PM
Old 03-03-2011
--Assumption here is fields in this file aren't actually named Field1a, Field2a, etc. but have real names.

Code:
awk -F'[;,]' '/^\)/{p=0}p==1{sub(/^[( ]*/,"",$1); print $1}/^Identifier/{p=1}' infile

Code:
sed -nr '/^Identifier/,/^\)/{s/^[ (]*([^,;]*)[,;]( *[^,;]*[;,])*$/\1/p}' infile


Last edited by Chubler_XL; 03-03-2011 at 11:58 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk parsing problem

I need help with a problem that I have not been able to figure out. I have a file that is about 650K lines. Records are seperated by blank lines, fields seperated by new lines. I was trying to make a report that would add up 2 fields and associate them with a CP. example output would be... (11 Replies)
Discussion started by: timj123
11 Replies

2. Shell Programming and Scripting

awk sed parsing

hi , i would like to parse some file with the fallowing data : data data data "unwanted data" data data "unwanted data" data data data data #unwanted data. what i want it to have any coments between "" and after # to be erased using awk or/and sed. has anyone an idea? thanks. (3 Replies)
Discussion started by: Darsh
3 Replies

3. Shell Programming and Scripting

Awk Parsing

Hi there Not to good in awk . So bear with me I would need a one liner to take a file with this in it name: joe smoe; group: group1; name: linda smith; ... (2 Replies)
Discussion started by: bombcan
2 Replies

4. Shell Programming and Scripting

awk and file parsing

Hi, I have a input file like this TH2TH2867Y NOW33332106Yo You Baby TH2TH3867Y NOW33332106No Way Out TH2TH9867Y NOW33332106Can't find it TJ2TJ2872N WOW33332017sure thing alas TJ2TJ3872N WOW33332017the sky rocks TJ2TJ4872N WOW33332017nothing else matters ... (4 Replies)
Discussion started by: devtakh
4 Replies

5. UNIX for Dummies Questions & Answers

parsing with awk

I have a file that reads like this: name:john name:bill name:james phone:123 phone:456 phone:789 i would like change the file so it appears like this: name:john phone:123 name:bill phone:456 name:james phone:789 any help is greatly appreciated! (1 Reply)
Discussion started by: chknstrp
1 Replies

6. Shell Programming and Scripting

parsing xml using awk

hello , i am trying to parse xml using awk however its a little bit tricky as i want <databases> <source> <host>prod</host> <port>1522</port> <tns>GP1</tns> <user>P11</user>... (6 Replies)
Discussion started by: amit1_x
6 Replies

7. Shell Programming and Scripting

XML Parsing using awk

Hi All, I have a problem to resolve. For following XML file, I need to parse the values based on Tag Name. I would prefer to use this by awk. I have used sed command to replace the tags (s/<SeqNo>//). In this case there can be new tags introduced. So need to parse it based on Tag Name. Any... (9 Replies)
Discussion started by: Tons
9 Replies

8. Shell Programming and Scripting

Parsing help ( awk)

Input File ( this is a sample record ) Storage Group Name: DRT_ny-iadsql1-c_ny-iadsql2-c Storage Group UID: 00:21:E9:C7:2D:E0:E1:11:82:CC:00:60:16:10:04:0A HBA/SP Pairs: HBA UID SP Name SPPort ------- ... (2 Replies)
Discussion started by: greycells
2 Replies

9. Shell Programming and Scripting

Another parsing question (awk)

Input File Name of the session: filesrv_quo snap Logical Units UID: 60:06:01:60:01:7B:25:00:C8:86:B0:CA:5B:A2:E0:11 Name of the session: verspn2_at_176_0218 snap Logical Units UID: Name of the session: DRT-ny-iadsql1-c_ny-iadsql2-c snap Logical Units UID: ... (4 Replies)
Discussion started by: greycells
4 Replies

10. Shell Programming and Scripting

awk script and parsing

Hello I am trying to find how to do the following with awk and other tools. Find a line in the file where the element 1 is equal to 12345, from the first occurrence, in that line find the element 11 what is equal to and print all lines in file where their element 11 is equal to the value of... (2 Replies)
Discussion started by: koutroul
2 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 02:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy