selection of context in files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting selection of context in files
# 1  
Old 12-09-2008
Search the file content in between the records

I have a file like this

QUEUE: <ITEM(69)> "/NLA///ACHO_EQU_IDX"
Q_KEY: <ITEM(69)> "/NLA///ACHO_EQU_IDX"
Q_TYPE: <VSTR(32)> "GEN_VSTR_INDEX"
QOBJ_TYPE: <VSTR(32)> "MSG_HISTORY_SEQ"
Q_DOMAIN: <VSTR(7)> "MESSAGE"
DUP_KEY_FLAG: <STR(1)> "Y"
PERIODIC_FLAG: <STR(1)> "N"
UNION_ID: <BITS(8)X> "00000000"
USED_BYTES: <LONG(10)X> "0"
ALLOCATED_BYTES: <LONG(10)X> "0"

QELEMENT: <LONG(10)> "1"
QELEMENT_ID: <LONG(10)S> "1"
QELEMENT_STATE: <VSTR(132)S> "JOIN"
VSTR_KEY$GEN_VSTR_INDEX: <VSTR(80)S> "EQUENS0002C081119081119081119"
SYSTIME$GEN_VSTR_INDEX: <TIME(23)S> "19-NOV-2008 20:55:34.38"
TXT$GEN_VSTR_INDEX: <VSTR(20)S> "2008111900000218"
HISTORY_COORDINATES: <HST_ID(23)S> "2/3"
MESSAGE_ID: <MSG_ID(17)S> "20081119/00000218"
END: <VSTR(48)> "QELEMENT"

QELEMENT: <LONG(10)> "2"
QELEMENT_ID: <LONG(10)S> "2"
QELEMENT_STATE: <VSTR(132)S> "JOIN"
VSTR_KEY$GEN_VSTR_INDEX: <VSTR(80)S> "EQUENS0002C081124081124081124"
SYSTIME$GEN_VSTR_INDEX: <TIME(23)S> "24-NOV-2008 12:51:51.83"
TXT$GEN_VSTR_INDEX: <VSTR(20)S> "2008112400000058"
HISTORY_COORDINATES: <HST_ID(23)S> "2/3"
MESSAGE_ID: <MSG_ID(17)S> "20081124/00000058"
END: <VSTR(48)> "QELEMENT"

QELEMENT: <LONG(10)> "3"
QELEMENT_ID: <LONG(10)S> "3"
QELEMENT_STATE: <VSTR(132)S> "JOIN"
VSTR_KEY$GEN_VSTR_INDEX: <VSTR(80)S> "EQUENS1100C081119081119081119"
SYSTIME$GEN_VSTR_INDEX: <TIME(23)S> "19-NOV-2008 20:54:15.93"
TXT$GEN_VSTR_INDEX: <VSTR(20)S> "2008111900000214"
HISTORY_COORDINATES: <HST_ID(23)S> "2/3"
MESSAGE_ID: <MSG_ID(17)S> "20081119/00000214"
END: <VSTR(48)> "QELEMENT"

QELEMENT: <LONG(10)> "4"
QELEMENT_ID: <LONG(10)S> "4"
QELEMENT_STATE: <VSTR(132)S> "JOIN"
VSTR_KEY$GEN_VSTR_INDEX: <VSTR(80)S> "EQUENS1100C081124081124081124"
SYSTIME$GEN_VSTR_INDEX: <TIME(23)S> "24-NOV-2008 11:15:48.27"
TXT$GEN_VSTR_INDEX: <VSTR(20)S> "2008112400000008"
HISTORY_COORDINATES: <HST_ID(23)S> "2/3"
MESSAGE_ID: <MSG_ID(17)S> "20081124/00000008"
END: <VSTR(48)> "QELEMENT"

QELEMENT: <LONG(10)> "5"
QELEMENT_ID: <LONG(10)S> "5"
QELEMENT_STATE: <VSTR(132)S> "JOIN"
VSTR_KEY$GEN_VSTR_INDEX: <VSTR(80)S> "EQUENS1100C081124081124081124"
SYSTIME$GEN_VSTR_INDEX: <TIME(23)S> "24-NOV-2008 12:17:44.78"
TXT$GEN_VSTR_INDEX: <VSTR(20)S> "2008112400000014"
HISTORY_COORDINATES: <HST_ID(23)S> "2/3"
MESSAGE_ID: <MSG_ID(17)S> "20081124/00000014"
END: <VSTR(48)> "QELEMENT"

END: <VSTR(48)> "QUEUE"
SHOW:[QUEUE:/NLA///ACHO_EQU_IDX ALL: END: ]
please find the attachment for more clarity .
but my concern is can i reform the text file into below o/p
TYPE MSG ID
EQUENS1100 20081124/00000014
20081124/00000008
20081119/00000214
EQUENS0002 20081124/00000058
20081119/00000218

this type column we fetched from VSTR_KEY$GEN_VSTR_INDEX in attached file and each types are associated with MESSAGE_ID .
any help will really appreciated........................

Last edited by manas_ranjan; 12-09-2008 at 06:06 PM..
# 2  
Old 12-09-2008
any suggestion on below problem....
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash selection of files with similar name

Hi all, This is my first day on Linux shell!!! So, I am trying to write a script that that will pick up pairs of files with the same name (not the same content) but that are different in one character (one is *R1 the other is *R2)... Something like: look ate the files, whenever they are the... (3 Replies)
Discussion started by: ALou
3 Replies

2. Shell Programming and Scripting

Questions related to if in awk context and if without awk context

I wrote this code, questions follow #! /bin/bash -f # Purpose - to show how if syntax is used within an awk clear; ls -l; echo "This will print out the first two columns of the inputted file in this directory"; echo "Enter filename found in this directory"; read input; ... (11 Replies)
Discussion started by: Seth
11 Replies

3. Shell Programming and Scripting

grep help after context

Hi, There's a file with below contents which I have to read based on the input parameter provided by the user. FILE_ID=1 FILE_FTP_ID=ftp.server1.com FILE_FTP_USER=user1 FILE_FTP_PASS=pass1 FILE_ID=2 FILE_FTP_ID=ftp.server2.com FILE_FTP_USER=user2 FILE_FTP_PASS=pass2 FILE_ID=3... (6 Replies)
Discussion started by: dips_ag
6 Replies

4. Shell Programming and Scripting

script to search context from 2 files based on date and name

Please Close thread- Thank You. (1 Reply)
Discussion started by: ezmethod
1 Replies

5. Shell Programming and Scripting

Paging/Scrolling a List of files for selection

Hi All, I have the following script and would like to add page up and down functionality to be able to stroll through the list. Is this possible? If so, Any pointers to examples, info, tips, suggestions would be appreciated. BTW, Any suggestion for better practices on the following code... (5 Replies)
Discussion started by: Festus Hagen
5 Replies

6. UNIX for Advanced & Expert Users

context lost problem

there are several same servers(process) on more than one server(machine) providing the same service. we store session/context within the server(process), if the same client login, he will be directed to the very server service for him last time. But, if a server(machine or process) down, the... (1 Reply)
Discussion started by: zhongyj
1 Replies

7. Shell Programming and Scripting

keep context in awk

here is a data file. ------------------------------------- KSH, CSH, BASH, PERL, PHP, SED, AWK KSH, CSH, BASH, PERL, PHP, BASH, PERL, PHP, SED, AWK CSH, BASH, PERL, PHP, SED, KSH, CSH, BASH, PERL, PHP, SED, AWK ------------------------------------- My desired output is... (2 Replies)
Discussion started by: VTAWKVT
2 Replies

8. UNIX for Advanced & Expert Users

selection of files based on its types

Daily we are getting some datafiles to our unix server location FTPIN. Incoming File names will be present in the location "/xyz/test/" as below: "infile_A1_YYYYMMDD", "infile_A2_YYYYMMDD", "infile_B1_YYYYMMDD", "infile_C1_YYYYMMDD" "infile_C2_YYYYMMDD" Where A, B and C are the... (3 Replies)
Discussion started by: ganapati
3 Replies

9. UNIX for Advanced & Expert Users

Context Switching

I know that this is a relative question but can someone give me an idea of what would be considered a high number of context switches? I am running vmstat and show a cs value of between 5000 and 6000 on a 4 processor system. How can I deduce if this number is high or not? Also, the timeslice... (2 Replies)
Discussion started by: keelba
2 Replies
Login or Register to Ask a Question