Sponsored Content
Full Discussion: AWK - Parse a big file
Top Forums Shell Programming and Scripting AWK - Parse a big file Post 302508741 by pravin27 on Tuesday 29th of March 2011 01:53:20 AM
Old 03-29-2011
Modified the code of cgkmal,Hope it will work for both cases. In your second inputfile, there is no Symmetrix Id.
Code:
 awk 'BEGIN{print "Symmetrix ID,DEV,Storage Group Name,Port Group Name,Initiator Group Name,Masking View Name,Port"}
{sub(/:/,": ")}
/Symmetrix/{a=$4}
/Masking View Name/{b=$5}
/Initiator Group Name/{c=$5}
/Port Group Name/{d=$5}
/Storage Group Name/{e=$5}
/Not Visible/{if(! /^ /){dev=$1;}print a","dev","e","d","c","b",01G:0_16G:0_03H:0_14H:0"}' testfilee

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to view a big file(143M big)

1 . Thanks everyone who read the post first. 2 . I have a log file which size is 143M , I can not use vi open it .I can not use xedit open it too. How to view it ? If I want to view 200-300 ,how can I implement it 3 . Thanks (3 Replies)
Discussion started by: chenhao_no1
3 Replies

2. Shell Programming and Scripting

filter parts of a big file using awk or sed script

I need an assistance in file generation using awk, sed or anything... I have a big file that i need to filter desired parts only. The objective is to select (and print) the report # having the string "apple" on 2 consecutive lines in every report. Please note that the "apple" line has a HEX... (1 Reply)
Discussion started by: apalex
1 Replies

3. Shell Programming and Scripting

Big data file - sed/grep/awk?

Morning guys. Another day another question. :rolleyes: I am knocking up a script to pull some data from a file. The problem is the file is very big (up to 1 gig in size), so this solution: for results in `grep "^\ ... works, but takes ages (we're talking minutes) to run. The data is held... (8 Replies)
Discussion started by: dlam
8 Replies

4. Shell Programming and Scripting

Parse file using awk and work in awk output

hi guys, i want to parse a file using public function, the file contain raw data in the below format i want to get the output like this to load it to Oracle DB MARWA1,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00 MARWA2,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00 this the file raw format: Number of... (6 Replies)
Discussion started by: dagigg
6 Replies

5. Shell Programming and Scripting

big xml file with nested loop parse

I have an xml file with the structure: <tag1> <value1>xyx</value1> <value2>123</value2> </tag1> <tag1> <value1>568</value1> <value2>zzzzz</value2> </tag1> where I want to parse each data pair in the this single file, so something like: find first tag1 data pair... (1 Reply)
Discussion started by: unclecameron
1 Replies

6. Shell Programming and Scripting

awk column comparison big file

Hi all, I would like to compare a column in one file to a column in another file and when there is a match it prints the first column and the corresponding second column. Example File1 ABA ABC ABE ABF File 2 ABA 123 ABB 124 ABD 125 ABC 126 So what I would like printed to a... (6 Replies)
Discussion started by: pcg
6 Replies

7. Shell Programming and Scripting

Parse a file with awk?

Hi guys (and gals). I need some help. I'm running an IVR purely on Asterisk where I capture the DTMFs. After pulsing each DTMF I have Asterisk write to a file with whatever was dialed (mostly used for record-keeping) and at the end of the survey I write all variables in a single line to a... (2 Replies)
Discussion started by: tulf210
2 Replies

8. Shell Programming and Scripting

Parse a file using awk

Hi Experts, I am trying to parse the following file; FILEA a|b|c|c|c|c a|b|d|d|d|d e|f|a|a|a|a e|f|b|b|b|boutput expected: a<TAB>b <TAB><TAB>c<TAB>c<TAB>c<TAB>c<TAB> <TAB><TAB>d<TAB>d<TAB>d<TAB>d<TAB> e<TAB>f <TAB><TAB>a<TAB>a<TAB>a<TAB>a<TAB> <TAB><TAB>b<TAB>b<TAB>b<TAB>b<TAB>*... (7 Replies)
Discussion started by: rajangupta2387
7 Replies

9. Shell Programming and Scripting

Using awk to Parse File

Hi all, I have a file that contains a good hundred of these job definitions below: Job Name Last Start Last End ST Run Pri/Xit ________________________________________________________________ ____________________... (7 Replies)
Discussion started by: atticuss
7 Replies

10. Shell Programming and Scripting

Split a big file into multiple files using awk

this thread is a continuation from previous thread https://www.unix.com/shell-programming-and-scripting/223901-split-big-file-into-multiple-files-based-first-four-characters.html ..I am using awk to split file and I have a syntax error while executing the below code I am using AIX 7.2... (4 Replies)
Discussion started by: etldev
4 Replies
FCNSQ(8)							  Open-FCoE Tools							  FCNSQ(8)

NAME
fcnsq - Fibre Channel Name Server Query Tool SYNOPSIS
fcnsq host --gpn port_id [-q | --quiet] fcnsq host --gnn port_id [-q | --quiet] fcnsq host --gspn port_id [-q | --quiet] fcnsq host --gsnn wwpn [-q | --quiet] fcnsq ? DESCRIPTION
The fcnsq command performs Fibre Channel Name Server queries for a user-specified FC Host. The supported name server query commands include: Get Port Name (GPN), Get Node Name (GNN), Get Symbolic Node Name (GSNN), and Get Symbolic Port Name (GSPN) as described in FC-GS-3 for the Common Transport (CT) services. fcnsq takes the host bsg name as the input for the target host. Host bsg name must be a valid bsg device, e.g., "host12" as derived from /dev/bsg/fc_host12. For each name server query command, the argument is either a Port ID or a World Wide Port Name. Port IDs and World Wide Names must be specified in hexadecimal. To disable verbose output, use the --quiet option. OPTIONS
host --gpn port_id Get Port Name by Port ID for host. host --gnn port_id Get Node Name by Port ID for host. host --gspn port_id Get Symbolic Port Name by Port ID for host. host --gsnn wwpn Get Symbolic Node Name by World Wide Port Name for host. -q, --quiet Disable verbose output. ? Display a help message with basic usage instructions. EXAMPLES
Query Get Port Name (GPN) from host12 for Port ID 0xbf0027 fcnsq host12 --gpn bf0027 Query Get Node Name (GNN) from host12 for Port ID 0xbf0027 fcnsq host12 --gnn bf0027 Query Get Symbolic Port Name (GSPN) from host12 for Port ID 0xbf0027 fcnsq host12 --gspn bf0027 Query Get Symbolic Node Name (GSNN) from host12 for WWWPN 0x1000001B213C9DDA fcnsq host12 --gsnn 0x1000001B213C9DDA SEE ALSO
fcoeadm(8) SUPPORT
fcnsq is part of the fcoe-utils package, maintained through the Open-FCoE project. Resources for both developers and users can be found at the Open-FCoE website http://open-fcoe.org/. Open-FCoE 06/09/2010 FCNSQ(8)
All times are GMT -4. The time now is 09:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy