Sponsored Content
Full Discussion: Parsing help ( awk)
Top Forums Shell Programming and Scripting Parsing help ( awk) Post 302842337 by greycells on Thursday 8th of August 2013 11:55:11 PM
Old 08-09-2013
Parsing help ( awk)

Input File ( this is a sample record )

Code:
 
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
  -------                                          -------     ------ 
  20:00:00:00:C9:9E:07:11:10:00:00:00:C9:9E:07:11   SP A         0
  20:00:00:00:C9:9E:07:11:10:00:00:00:C9:9E:07:11   SP B         1
  20:00:00:00:C9:9E:1F:6A:10:00:00:00:C9:9E:1F:6A   SP B         0
  20:00:00:00:C9:9E:1F:6A:10:00:00:00:C9:9E:1F:6A   SP A         1
HLU/ALU Pairs:
  HLU Number     ALU Number
  ----------     ----------
HLU/SLU Pairs:
 HLU No.  SNAP SHOT UID                                     SNAP SHOT NAME
 ------  -----------------------------------------------    --------------
 1       60:06:01:60:32:BB:21:00:B0:AB:B3:FD:33:E0:E1:11      ny-iadsql1_2-cj-2450-0916-31_DRBCV
 2       60:06:01:60:32:BB:21:00:CC:07:E9:04:34:E0:E1:11      ny-iadsql1_2-cj-2450-0916-32_DRBCV
 0       60:06:01:60:32:BB:21:00:0E:DF:3F:17:9F:00:E3:11      ny-iadsql1-cj_nypiadsql2-cj_LUN_1216_R2_DRBCV

Need the output in this format

Code:
 
UID,SNAPSHOTNAME,HLU,STORAGEGROUP
60:06:01:60:32:BB:21:00:B0:AB:B3:FD:33:E0:E1:11,nyp-iadsql1_2-cj-2450-0916-31_DRBCV,1,DRT_ny-iadsql1-c_ny-iadsql2-c
60:06:01:60:32:BB:21:00:CC:07:E9:04:34:E0:E1:11,nyp-iadsql1_2-cj-2450-0916-32_DRBCV,2,DRT_ny-iadsql1-c_ny-iadsql2-c
60:06:01:60:32:BB:21:00:0E:DF:3F:17:9F:00:E3:11,nyp-iadsql1-cj_nypiadsql2-cj_LUN_1216_R2_DRBCV,0,DRT_ny-iadsql1-c_ny-iadsql2-c

The file has number of records like this ....

Thanks
 

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

Parsing through Awk

Hi All, I have an input file something like this: Line1 Line2 .... LineN Identifier ( Field1a, Field1b; Field2a, Field1b; Field3a, Field1b; ..... ) LineN+1 LineN+2 etc.. I basically need Field1a, Field2a, Field3a.... from the above file (6 Replies)
Discussion started by: tostay2003
6 Replies

8. 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

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
AUTRACE:(8)						  System Administration Utilities					       AUTRACE:(8)

NAME
autrace - a program similar to strace SYNOPSIS
autrace program [-r] [program-args]... DESCRIPTION
autrace is a program that will add the audit rules to trace a process similar to strace. It will then execute the program passing arguments to it. The resulting audit information will be in the audit logs if the audit daemon is running or syslog. This command deletes all audit rules prior to executing the target program and after executing it. As a safety precaution, it will not run unless all rules are deleted with auditctl prior to use. OPTIONS
-r Limit syscalls collected to ones needed for analyzing resource usage. This could help people doing threat modeling. This saves space in logs. EXAMPLES
The following illustrates a typical session: autrace /bin/ls /tmp ausearch --start recent -p 2442 -i and for resource usage mode: autrace -r /bin/ls ausearch --start recent -p 2450 --raw | aureport --file --summary ausearch --start recent -p 2450 --raw | aureport --host --summary SEE ALSO
ausearch(8), auditctl(8). AUTHOR
Steve Grubb Red Hat Jan 2007 AUTRACE:(8)
All times are GMT -4. The time now is 11:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy