help in script

Hi,

I have a log file with this format

field1 - field2 field3 ....field9 field10

I need to do the following:

Select lines matching a specific pattern in field8
If field9 equals 111, echo field2 in the list List1
If field9 equals 222, echo field2 in the list List2

So the output of the script is

List1

field9
field9
field9
Liste2

field9
field9
field9

So far, I did the first part using grep and I redirect to a temporary file.

can you please help me building the rest of the script?
thanks

can you please elaborate this.
also what is the pattern of the file? are the first and second filed is delimited by " - " and after third a space as you mentiond?

better to post some sample data and the required output.

Might as well post whatever script you have built so far as well.

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

Hi

I want to transform this file

[JUPITER]
master=NLWNSCK,jupiter,6500
query=NLWNSCK,jupiter,6500

[ZEUS1]
master=NLWNSCK,zeus,3000
query=NLWNSCK,zeus,3000

to

dn: sybaseServername=JUPITER,dc=siroe,dc=com
sybaseServername: JUPITER
objectClass: sybaseServer
sybaseAddress: TCP#1#jupiter 6500

dn: sybaseServername=ZEUS1,dc=siroe,dc=com
sybaseServername: ZEUS1
objectClass: sybaseServer
sybaseAddress: TCP#1#zeus 3000

thanks for your help