search file and group values with problematic tab


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting search file and group values with problematic tab
# 1  
Old 01-05-2011
Data search file and group values with problematic tab

hi people;
the similar topic is being opened in here and here but i have confused with following condition. so i wanted to open a seperate topic.

from my file.txt:
Code:
...
...
...
110105-16:04:04 192.168.1.1 7.1j Port_NODE_MODEL_M_1_8 stopfile=/tmp/10544
=================================================================
MO                                                      Attribute         Value
=================================================================
Sector=1                                                height            2500
Sector=3                                                height            2500
Sector=2                                                height            2500
=================================================================
Total: 3 results
...
...
110105-16:04:04 192.168.1.1 7.1j Port_NODE_MODEL_M_1_8 stopfile=/tmp/10544
==================================================================
MO                                                      Attribute         Value
==================================================================
PredefRbsScannerGpeh=1                                  fileLocation      /c/pm_data/
==================================================================
Total: 1 results
...
...
110105-16:04:04 192.168.1.1 7.1j Port_NODE_MODEL_M_1_8 stopfile=/tmp/10544
==================================================================
MO                                                      Attribute         Value
==================================================================
==================================================================
Total: 0 results
...
...
110105-16:04:04 192.168.1.1 7.1j Port_NODE_MODEL_M_1_8 stopfile=/tmp/10544
==================================================================
MO                                                      Attribute         Value
==================================================================
SectorAntenna=3,AntennaBranch=A                         fqBandHighEdge    21550
SectorAntenna=3,AntennaBranch=B                         fqBandHighEdge    21550
SectorAntenna=1,AntennaBranch=B                         fqBandHighEdge    21550
SectorAntenna=1,AntennaBranch=A                         fqBandHighEdge    21550
SectorAntenna=2,AntennaBranch=B                         fqBandHighEdge    21550
SectorAntenna=2,AntennaBranch=A                         fqBandHighEdge    21550
==================================================================
...
...
110105-16:04:04 192.168.4.2 7.1j Port_NODE_MODEL_M_1_8 stopfile=/tmp/10544
==================================================================
MO                                                      Attribute         Value
==================================================================
Sector=1                                                height            2700
Sector=3                                                height            2700
Sector=2                                                height            2700
===================================================================
Total: 3 results
...

this report will be put into excel and it must be seen clearly. so i want to see this report as:
Image

it is enough to group these values and write them seperated with tab. but the problem is, some attributes have 3-sectors where some of them has 1-sector, some of them have 6. so the tabs must be put carefully.
i have really confused Smilie
Code:
192.168.1.1	Sector=1	height	2500	PredefRbsScannerGpeh=1	fileLocation	/c/pm_data/	SectorAntenna=3,AntennaBranch=A	fqBandHighEdge	21550
		Sector=3	height	2500								SectorAntenna=3,AntennaBranch=B	fqBandHighEdge	21550
		Sector=2	height	2500								SectorAntenna=1,AntennaBranch=B	fqBandHighEdge	21550
													SectorAntenna=1,AntennaBranch=A	fqBandHighEdge	21550
													SectorAntenna=2,AntennaBranch=B	fqBandHighEdge	21550
													SectorAntenna=2,AntennaBranch=A	fqBandHighEdge	21550
...		...		...	...	...			...		...		...
...		...		...	...	...			...		...		...

192.168.4.2	Sector=1	height	2700	PredefRbsScannerGpeh=1	fileLocation	/d/pm_data/	SectorAntenna=3,AntennaBranch=A	fqBandHighEdge	31550
		Sector=3	height	2700								SectorAntenna=3,AntennaBranch=B	fqBandHighEdge	31550
		Sector=2	height	2700								SectorAntenna=1,AntennaBranch=B	fqBandHighEdge	31550
													SectorAntenna=1,AntennaBranch=A	fqBandHighEdge	31550
													SectorAntenna=2,AntennaBranch=B	fqBandHighEdge	31550
													SectorAntenna=2,AntennaBranch=A	fqBandHighEdge	31550
...		...		...	...	...			...		...		...
...		...		...	...	...			...		...		...

hard to tell, hard to understand, really hard to script it..!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Replace Stub Values In One Group Of Files With Actual Values From Another Group Of Files

I have two directories of files (new-config-files and old-config-files): new-config-files/this-db/config.inc.php new-config-files/that-db/config.inc.php new-config-files/old-db/config.inc.php new-config-files/new-db/config.inc.php new-config-files/random-database/config.inc.php etc. ... (4 Replies)
Discussion started by: spacegoose
4 Replies

2. UNIX for Dummies Questions & Answers

Sort tab delimited file according to which rows have missing values

Hello! I have a tab delimited file with values in three columns. Some values occur in all three columns, other values are present in only one or two columns. I would like to sort the file so that rows with no missing values come first, rows with one missing values come next, and rows with two... (9 Replies)
Discussion started by: MBarrett1213
9 Replies

3. Shell Programming and Scripting

Query the table and return values to shell script and search result values from another files.

Hi, I need a shell script, which would search the result values from another files. 1)execute " select column1 from table_name" query on the table. 2)Based on the result, need to be grep from .wft files. could please explain about this.Below is the way i am using. #!/bin/sh... (4 Replies)
Discussion started by: Rami Reddy
4 Replies

4. Shell Programming and Scripting

need a one liner to grep a group info from /etc/group and use that result to search passwd file

/etc/group tiadm::345:mk789,po312,jo343,ju454,ko453,yx879,iy345,hn453 bin::2:root,daemon sys::3:root,bin,adm adm::4:root,daemon uucp::5:root /etc/passwd mk789:x:234:1::/export/home/dummy:/bin/sh po312:x:234:1::/export/home/dummy:/bin/sh ju454:x:234:1::/export/home/dummy:/bin/sh... (6 Replies)
Discussion started by: chidori
6 Replies

5. Shell Programming and Scripting

Column matching and group setting in tab demited file

Please help me with commands for the following file operations File description 5 columns in total , sorted by column 1 value First formatting, 1) Records with duplicate column 1 values are to be ignored. Just consider the first occurrence of such a record. 2) Records with (column 2 -... (3 Replies)
Discussion started by: newbie83
3 Replies

6. Shell Programming and Scripting

printing two values with TAB in between

Dear friends, I want to print variables' values in certain format where space between two values of variables is "a tab" I tried where I provided "tab" between two varibales. But when it print values on screen its giving me output without spaces in two values. Request you to help me in... (7 Replies)
Discussion started by: anushree.a
7 Replies

7. Shell Programming and Scripting

AWK: read values from file1; search for values in file2

I have read another post about this issue and am wondering how to adapt it to my own, much simpler, issue. I have a file of user IDs like so: 333333 321321 546465 ...etc I need to take each number and use it to print records wherein the 5th field matches the user ID pulled from the... (2 Replies)
Discussion started by: Bubnoff
2 Replies

8. Shell Programming and Scripting

Retrieving values from tab-delimited file in unix script

Hi I am trying to retrieve values from a tab-delimited file.I am using while read record value=`echo $record | cut -f12` done Where 12 is the column no i want retieve and record is one line of the file. But it is returning the full record. Plz help (4 Replies)
Discussion started by: akashtcs
4 Replies

9. Shell Programming and Scripting

a tab between values

Hi, I have a file that looks like this: 36- 9+ 45- 43+ 400- 700+ I want to put a space between the number and the -/+ sign. So the output file will look like this 36 - 9 + 45 - 43 + 400 - 700 + (3 Replies)
Discussion started by: kylle345
3 Replies

10. Shell Programming and Scripting

Korn Shell Script - Read File & Search On Values

I am attempting to itterate through a file that has multiple lines and for each one read the entire line and use the value then to search in other files. The problem is that instead of an entire line I am getting each word in the file set as the value I am searching for. For example in File 1... (2 Replies)
Discussion started by: run_unx_novice
2 Replies
Login or Register to Ask a Question