How to format or create a matrix report from file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to format or create a matrix report from file
# 1  
Old 12-23-2008
How to format or create a matrix report from file

Dear Unix champs,

I have a input file as attached, i would like to create an report from the file as below
FileType | EQUENS0001 | EQUENS0002 | EQUENS1100 | EQUENS0003
--------+--------------------------------------------------------
Msg No | 20081219/00000006|20081219/00000007|20081219/00000005|-
20081219/00000015| | | |
I have AIX box, where i did (it will give me file type and message number)
grep -E "MESSAGE_ID|VSTR_KEY$GEN_VSTR_INDEX" filename
VSTR_KEY$GEN_VSTR_INDEX: <VSTR(80)S> "EQUENS0001C081222081222081222"
MESSAGE_ID: <MSG_ID(17)S> "20081219/00000006"
VSTR_KEY$GEN_VSTR_INDEX: <VSTR(80)S> "EQUENS0002C081222081222081222"
MESSAGE_ID: <MSG_ID(17)S> "20081219/00000007"
VSTR_KEY$GEN_VSTR_INDEX: <VSTR(80)S> "EQUENS1100C081222081222081222"
MESSAGE_ID: <MSG_ID(17)S> "20081219/00000005"
VSTR_KEY$GEN_VSTR_INDEX: <VSTR(80)S> "EQUENS0001C081222081222081222"
MESSAGE_ID: <MSG_ID(17)S> "20081219/00000015"
but now my problem is how I will extract next file type ?? if mulitiple messsage id s are present for that particular VSTR_KEY$GEN_VSTR_INDEX .
# 2  
Old 12-24-2008
any update or any suggestion will be really appreciated.....
# 3  
Old 12-24-2008
Maybe you could use grep -n to get the numbers of all lines specifying a file type, then process the source file "in parts", e.g. 10 lines down from every "grepped line" returned ... just an idea, though Smilie
# 4  
Old 12-24-2008
thank u so much for your idea and suggestion......i did the below method and able to extract the file in some manner ,
grep -E "VSTR_KEY$GEN_VSTR_INDEX|MESSAGE_ID" a.txt | awk -F" " '{print $4}'
"EQUENS0001C081222081222081222"
"20081219/00000006"
"EQUENS0002C081222081222081222"
"20081219/00000007"
"EQUENS1100C081222081222081222"
"20081219/00000005"
so now my query is can i format this o/p to below
"EQUENS0001C081222081222081222"-"20081219/00000006"
"EQUENS0002C081222081222081222"-"20081219/00000007"
"EQUENS1100C081222081222081222"-"20081219/00000005"
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Create movie from jpg (or other picture format) file

hi linux expert is there any program for create movie file from pictures file (like jpg)? Many Thanks samad (1 Reply)
Discussion started by: abdossamad2003
1 Replies

2. Shell Programming and Scripting

How to create a file from output of vertica table query in UTF-8 format?

Hello, In my shell script, I extract table data from HP Vertica DB into a csv file using vsql -c command. But the problem is the file getting created is in binary format and hence some of the data becomes unreadable which has chinese characters as part of data. file -i filename.csv - gives... (2 Replies)
Discussion started by: Dharmatheja
2 Replies

3. Shell Programming and Scripting

Needed touch command to create a file in the following format

needed touch command to create a file in the following format touch a_yyyymmdd_hhmmss (1 Reply)
Discussion started by: hemanthsaikumar
1 Replies

4. Programming

Transforming 3 columns to matrix format

Dear All I have a huge data for 3 columns similar to this D2cls0 D2cls0 1 D2cls0 D2cls1 0.308 D2cls0 D2cls2 0.554 D2cls0 D2cls3 0.287 D2cls0 D2cls4 0.633 D2cls0 D2cls5 0.341 D2cls0 D2cls6 0.665 D2cls0 D2cls7 0.698 D2cls0 D2cls8 0.625 D2cls0 D2cls9 0.429 I... (9 Replies)
Discussion started by: bala06
9 Replies

5. Shell Programming and Scripting

Create a report for client with a text data file

Hi, I am an amateur bash scriptwriter and I need to write a script which creates a report in a formatted, easy to read table-like that is displayed to standard output. The script has to export the followings: Process ID,User Name, Command Name,Priority..... Now I have a file that I can see all... (3 Replies)
Discussion started by: bashily
3 Replies

6. Shell Programming and Scripting

awk? create similarity matrix by calculating overlaps between sets comprising of individual parts

Hi everyone I am very new at awk and to me the task I need to get done is very very challenging... Nevertheless, after admiring how fast and elegant issues are being solved here I am sure this is my best chance. I have a 2D data file (input file is a plain tab-delimited text file). The first... (1 Reply)
Discussion started by: stonemonkey
1 Replies

7. UNIX for Advanced & Expert Users

to create format file for bcp in

I want to create the format file for bcp in a file to the table. My Versions are: Unix: Sun OS, DB: Sybase. How can i create the format file. Is there any way to create the format by bcp command or some system sp. Please help. (3 Replies)
Discussion started by: Arunprasad
3 Replies

8. Shell Programming and Scripting

Help to Create this file format structure

This data comes form the table and exported into the file in this format File1 Format weboffercode1,sourcecode1,1,1,1,1,1,1 weboffercode1,sourcecode2,1,1,1,1,1,1 weboffercode1,sourcecode1,1,1,1,1,1,1 weboffercode1,sourcecode3,1,1,1,1,1,1 weboffercode1,sourcecode3,1,1,1,1,1,1 ... (4 Replies)
Discussion started by: enigma_83
4 Replies

9. UNIX for Dummies Questions & Answers

create data file from report file

Dear Ones, kindly help me to create a data file from the report file as shown here under( i am new one to unix KNOW BASIC COMMANDS) file:rama.prt (ist record)(3 to 4 lines of text with different filed names) Name :M.LALITHA DOB:12/11/45 DESG :JA(P) STANO:300175 ... (3 Replies)
Discussion started by: cvvsnm
3 Replies

10. UNIX for Dummies Questions & Answers

How to create concatenate a file in tab format

Hi, Do you know given a file which is SED at the same time, how to read it and AWK it in tabs format. Means:- I have an input file which is (at the same time perform sed):- 1 2 3 4 5 6 7 I would like to print out in tab format which is:- 1 2 3 4 5 6 7 .... (12 Replies)
Discussion started by: ahjiefreak
12 Replies
Login or Register to Ask a Question