Identify nodes in the same level using a pattern

K

karthik.prabaharan

Hi,

Can someone help me with a solution for the following?

I have a text file in the following fashion:

Level, ID, Rev,Name,Date
0, PRGCD338HL, 2, F_Program, Jan-10-2006
1, PHCD3380229H2, 1, F_Placeholder, Feb-11-2006
2, DSCD3380229H1, 1, F_DesignSolution, Jan-21-2006
3, FDR0022904NPSM6, 1, F_DesignRep, Feb-11-2006
1, PHCD3380229H4, 1, F_Placeholder, Jan-10-2006
2, FDR0022904NPSM6, 1, F_DesignRep, Apr-01-2006
2, FDR022904NPSM1, 1, F_DesignRep, Jan-21-2004
1, PHCD3380229H3, 1, F_Boxholder, Jan-10-2002
2, FDR0022904NPSM6, 1, F_DesignRep, Jan-31-2003
2, FDR022904NPSM1, 1, F_DesignRep, Feb-11-2006
1, PHCD3380229H4, 1, F_Placeholder, Jan-10-2006
2, PHCD3380229H4, 1, F_Placeholder, Jan-10-2006
3, FDR0022904NPSM6, 1, F_DesignRep, Apr-01-2006
3, FDR022904NPSM1, 1, F_DesignRep, Jan-21-2004

I need to identify all the nodes in the same level attached to
F_Placeholder immediately.

For the above input, I require the following output:

2, DSCD3380229H1, 1, F_DesignSolution, Jan-21-2006

2, FDR0022904NPSM6, 1, F_DesignRep, Apr-01-2006
2, FDR022904NPSM1, 1, F_DesignRep, Jan-21-2004

3, FDR0022904NPSM6, 1, F_DesignRep, Apr-01-2006
3, FDR022904NPSM1, 1, F_DesignRep, Jan-21-2004

Thanks,
Karthik
 
P

Paul Lalli

Can someone help me with a solution for the following?

In order to "help" you with a solution, someone would need to see your
attempt at a solution first.
I have a text file in the following fashion:

Level, ID, Rev,Name,Date
0, PRGCD338HL, 2, F_Program, Jan-10-2006
1, PHCD3380229H2, 1, F_Placeholder, Feb-11-2006
2, DSCD3380229H1, 1, F_DesignSolution, Jan-21-2006
3, FDR0022904NPSM6, 1, F_DesignRep, Feb-11-2006
1, PHCD3380229H4, 1, F_Placeholder, Jan-10-2006
2, FDR0022904NPSM6, 1, F_DesignRep, Apr-01-2006
2, FDR022904NPSM1, 1, F_DesignRep, Jan-21-2004
1, PHCD3380229H3, 1, F_Boxholder, Jan-10-2002
2, FDR0022904NPSM6, 1, F_DesignRep, Jan-31-2003
2, FDR022904NPSM1, 1, F_DesignRep, Feb-11-2006
1, PHCD3380229H4, 1, F_Placeholder, Jan-10-2006
2, PHCD3380229H4, 1, F_Placeholder, Jan-10-2006
3, FDR0022904NPSM6, 1, F_DesignRep, Apr-01-2006
3, FDR022904NPSM1, 1, F_DesignRep, Jan-21-2004

I need to identify all the nodes in the same level attached to
F_Placeholder immediately.

For the above input, I require the following output:

2, DSCD3380229H1, 1, F_DesignSolution, Jan-21-2006

2, FDR0022904NPSM6, 1, F_DesignRep, Apr-01-2006
2, FDR022904NPSM1, 1, F_DesignRep, Jan-21-2004

3, FDR0022904NPSM6, 1, F_DesignRep, Apr-01-2006
3, FDR022904NPSM1, 1, F_DesignRep, Jan-21-2004

What have you tried so far? How did it fail to realize your goal?
What error or faulty output did it create that you don't understand?

Note that, in general, this newsgroup does not function as a "write
some code for me" helpdesk. You have to show that you've put forth
some effort into solving your problem first.

Have you read the Posting Guidelines that are posted here twice a week?
They contain invaluable information on how to get the most, best help
out of this newsgroup.

Paul Lalli
 
I

it_says_BALLS_on_your forehead

Hi,

Can someone help me with a solution for the following?

I have a text file in the following fashion:

Level, ID, Rev,Name,Date
0, PRGCD338HL, 2, F_Program, Jan-10-2006
1, PHCD3380229H2, 1, F_Placeholder, Feb-11-2006
2, DSCD3380229H1, 1, F_DesignSolution, Jan-21-2006
3, FDR0022904NPSM6, 1, F_DesignRep, Feb-11-2006
1, PHCD3380229H4, 1, F_Placeholder, Jan-10-2006
2, FDR0022904NPSM6, 1, F_DesignRep, Apr-01-2006
2, FDR022904NPSM1, 1, F_DesignRep, Jan-21-2004
1, PHCD3380229H3, 1, F_Boxholder, Jan-10-2002
2, FDR0022904NPSM6, 1, F_DesignRep, Jan-31-2003
2, FDR022904NPSM1, 1, F_DesignRep, Feb-11-2006
1, PHCD3380229H4, 1, F_Placeholder, Jan-10-2006
2, PHCD3380229H4, 1, F_Placeholder, Jan-10-2006
3, FDR0022904NPSM6, 1, F_DesignRep, Apr-01-2006
3, FDR022904NPSM1, 1, F_DesignRep, Jan-21-2004

I need to identify all the nodes in the same level attached to
F_Placeholder immediately.

For the above input, I require the following output:

2, DSCD3380229H1, 1, F_DesignSolution, Jan-21-2006

2, FDR0022904NPSM6, 1, F_DesignRep, Apr-01-2006
2, FDR022904NPSM1, 1, F_DesignRep, Jan-21-2004

3, FDR0022904NPSM6, 1, F_DesignRep, Apr-01-2006
3, FDR022904NPSM1, 1, F_DesignRep, Jan-21-2004

2, PHCD3380229H4, 1, F_Placeholder, Jan-10-2006

is a 'node' attached to F_Placeholder. why should that not show up in
your output?
 
U

usenet

I need to identify all the nodes in the same level attached to
F_Placeholder immediately.

For the above input, I require the following output:

I will assume that the demanding tone of your question is because
English is not your first language (not because you are trying to be
rude). However, you multi-posted this question also to comp.lang.awk,
and multi-posting is ALWAYS rude.

Please read the posting guidelines for this group. Tad's server (where
the guidelines are normally hosted) seems to be down at the moment, but
the guidelines are posted to this newsgroup regularly and may be read
here: http://tinyurl.com/obcre
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top