Sponsored Content
Full Discussion: iterative parsing
Top Forums Shell Programming and Scripting iterative parsing Post 302496843 by ctsgnb on Tuesday 15th of February 2011 12:16:02 PM
Old 02-15-2011
@Jouuuu

(condition){action}
for lines matching condition, actions are performed
NR>2 if the record number is more than 2 (that skip the first 2 lines)
&&/^SCHED / and the line start by the pattern SCHED<SPACE>
x=$2" "$5 put fields 2 and 5 separated by space into the variable x
/^SCHEDWIN/ if line start with pattern SCHEDWIN
x=x" "$2" "$4" "$6" "$8" "$10" "$12" "$14 concatenate the wanted field into the variable x
print x" SCHEDPOOL SCHEDRL SCHEDFOE SCHEDSG" Print x and concatenate the rest of the wanted string
@Scruti

Yes, i am still an awk noobzor


Smilie

Last edited by ctsgnb; 02-15-2011 at 01:21 PM..
This User Gave Thanks to ctsgnb For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

parsing

Hi, I want to parse this file.... ( 0 , 0 ) =>heading1 ( 0 , 1 ) =>value1.1a ( 0 , 2 ) =>value2.1a ( 1 , 0 ) =>heading2 ( 1 , 1 ) =>value1.1b ( 1 , 2 ) =>value2.1b ( 2 , 0 ) =>heading3 ( 2 , 1 ) =>value1.1c ( 2 , 2 ) =>value2.1c ( 3 , 0 ) =>heading4 ( 3 , 1 ) =>value1.1d ( 3 , 2... (15 Replies)
Discussion started by: tungaw2004
15 Replies

2. Shell Programming and Scripting

Parsing question

Hi Guys, I was wondering if you could help me out - I have a directory /home/users/datafiles/ which contain files "dat dd-mm-yy.xls" I am trying to write a script which does the following - (1) loops through all the files (2) retrieves the dd-mm-yy string and converts it into a... (12 Replies)
Discussion started by: muser
12 Replies

3. Shell Programming and Scripting

Need some help with parsing

I have a big xml file with little formatting in it. It contains over 600 messages that I need to break each message out in its own separate file. The xml file looks in the middle of it something like this: </Title></Msg><Msg><Opener> Hello how are you?<Title> Some says hello</Title><Body>... (3 Replies)
Discussion started by: quixoticking11
3 Replies

4. Shell Programming and Scripting

Perl parsing compared to Ksh parsing

#! /usr/local/bin/perl -w $ip = "$ARGV"; $rw = "$ARGV"; $snmpg = "/usr/local/bin/snmpbulkget -v2c -Cn1 -Cn2 -Os -c $rw"; $snmpw = "/usr/local/bin/snmpwalk -Os -c $rw"; $syst=`$snmpg $ip system sysName sysObjectID`; sysDescr.0 = STRING: Cisco Internetwork Operating System Software... (1 Reply)
Discussion started by: popeye
1 Replies

5. Shell Programming and Scripting

Iterative operation

grep -o '\{1,3\}\.\{1,3\}\.\{1,3\}\.\{1,3\}' then how do i iterate the file names?? (19 Replies)
Discussion started by: ravis83
19 Replies

6. Shell Programming and Scripting

Need help with some iterative file processing

Gurus - Please help with this urgent situation. I have the following problem to solve using a shell script: 1. There are about 13 files named CONTAINER_1.lst, CONTAINER_2.lst, CONTAINER_3.lst .....CONTAINER_13.lst 2. Each of these files contain about 8 lines (in most cases) containing... (1 Reply)
Discussion started by: inditopgun
1 Replies

7. Shell Programming and Scripting

Parsing the data

Hi I need to parse the following data using shell script Table ----- stage4n_abc 48 stage4o_abcd 4 adashpg_abc_HeartBeat 1 stage4l_asc 168 Can anyone gimme the solution. I want each value to get stored in an array or variable and want the value to be greped from another file.... (1 Reply)
Discussion started by: Archana.Dheepan
1 Replies

8. Shell Programming and Scripting

Iterative statement to cut values from a line

Hi I am new to shell scripting and trying to get values from a text file, I have a text file with values seperated with "|". like aga|120220090525|120220090525|120220090525|120220090530 bab|120220090530|120220090530|120220090535|120220090535|120220090535... (4 Replies)
Discussion started by: mannepalli
4 Replies

9. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

10. Shell Programming and Scripting

parsing

Can some body show me a sed command to remove everyhing upto a '/' and leave the rest of the line. cat data.out This is the directory /tmp/xxx/yy.ksh I only want to get the fullpath name /tmp/xxx.yy.ksh Thanks in advance to all who answer. (3 Replies)
Discussion started by: BeefStu
3 Replies
pfscat(1)						      General Commands Manual							 pfscat(1)

NAME
pfscat - Concatenate frames in PFS stream SYNOPSIS
pfscat [--horizontal] [--vertical] [-j <type>] [-R <val>] [-G <val>] [-B <val>] [-Y <val>] [--help] image1.pfs image2.pfs ... DESCRIPTION
Read number of frames as input, stitch them either horizontally or vertically, and produce single frame as output. If frames are not all the same size they are justified with each other - by default they are centered, but can also be flushed with a specified edge. OPTIONS
--horizontal, -H Stitch frames horizontally. --vertical, -V Stitch frames vertically. -j <type> Specify justification of input frames. Predefined types are: min, max, center. -R <val>, -G <val>, -B <val> Color of an extra space in a resulting image. Default color is black, and if some of the components is not specified, its value is set to 0.0. -Y <val> Color of an extra space in luminance mode. --help, -h Print a list of commandline options. EXAMPLES
pfsinmulti anim1_%04d.hdr anim2_%04d.hdr -- pfscat @1 @2 --vertical Stitch two hdr animations in vertical alignment. 'pfscat' is taken as an argument by 'pfsinmulti', therefore it must be preceded with '--'. Number of @1 @2 ... @n arguments must be the same as number of animations to combine. NOTES
Note that either --horizontal or --vertical option must be specified. SEE ALSO
pfsin(1) pfsout(1) BUGS
Please report bugs and comments to Dorota Zdrojewska <dzdrojewska@wi.ps.pl>. pfscat(1)
All times are GMT -4. The time now is 04:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy