Results 1 to 7 of 7
Following is input:
<P
align="justify"
><FONT size="+1" color="#221E1F">the tiny bundles of hairs that protrude from them. Waves in the fluid of the inner ear stimulate the hair cells. Like the ...
- 12-23-2008 #1Just Joined!
- Join Date
- Dec 2008
- Posts
- 3
Need help to extract <P> tags in a custom manner from below mwntioned input.
Following is input:
<P
align="justify"
><FONT size="+1" color="#221E1F">the tiny bundles of hairs that protrude from them. Waves in the fluid of the inner ear stimulate the hair cells. Like the rods and cones in the eye, the hair cells convert this physical stimulation into neural im<FONT size="+1" color="#221E1F">pulses that are sent to the brain (Hudspeth, 2000). </P
><P
align="justify"
>These signals are routed through the thalamus to the auditory cortex, which is located mostly in the temporal lobes of the brain. Studies demonstrate that the auditory cortex has specialized cells—similar to the feature detectors found in the visual cortex—that have special sensitivity to certain features of sound (Pickles, 198
. Evidence also suggests that the parallel processing of input seen in the visual system also occurs in the auditory pathways (Rouiller, 1997). </P
><DIV class="Part"
><DIV class="Sect"
><H4
align="justify"
><FONT size="+1" color="#8E2E33"><B>Auditory Perception: Theories of Hearing </H4
><P
><FONT size="+1" color="#007AA4">Figure 4.50 <FONT size="+1">The basilar membrane.<FONT size="+1" color="#221E1F"> This graphic shows how the cochlea might look if it were un<FONT size="+1"><B>wound and cut open to reveal the basilar membrane, which is covered with thousands of hair cells (the auditory receptors). Pressure waves in the fl uid filling the cochlea cause oscillations to travel in waves down the basilar membrane, stimulating the hair cells to fi re. Although the entire membrane vibrates, as predicted by frequency theory, the point along the membrane where the wave peaks depends on the frequency of the sound stimulus, as suggested by place theory. </P
><IMG align="" width="339" height="240"
src="http://www.unix.com/images/a_img_0.jpg" ></DIV
></DIV
></DIV
>
My output requirements are:
1. To strip all attributes within <P> tags keeping <B> and <I> tag within data.
2. Delete all attribute within H4 tags and replace resulting <H4> tag with <P> tag.
3. Delete outer <Div> tags surrounding <P> tags.
So my OUTPUT will be:
<P>the tiny bundles of hairs that protrude from them. Waves in the fluid of the inner ear stimulate the hair cells. Like the rods and cones in the eye, the hair cells convert this physical stimulation into neural impulses that are sent to the brain (Hudspeth, 2000).</P>
<P>These signals are routed through the thalamus to the auditory cortex, which is located mostly in the temporal lobes of the brain. Studies demonstrate that the auditory cortex has specialized cells—similar to the feature detectors found in the visual cortex—that have special sensitivity to certain features of sound (Pickles, 198
. Evidence also suggests that the parallel processing of input seen in the visual system also occurs in the auditory pathways (Rouiller, 1997).</P>
<P>This graphic shows how the cochlea might look if it were un<FONT size="+1"><B>wound and cut open to reveal the basilar membrane, which is covered with thousands of hair cells (the auditory receptors). Pressure waves in the fl uid filling the cochlea cause oscillations to travel in waves down the basilar membrane, stimulating the hair cells to fi re. Although the entire membrane vibrates, as predicted by frequency theory, the point along the membrane where the wave peaks depends on the frequency of the sound stimulus, as suggested by place theory.</P>
<IMG align="" width="339" height="240" src="http://www.unix.com/images/a_img_0.jpg" >
Thanks a Ton!!!
- 12-24-2008 #2Just Joined!
- Join Date
- Dec 2008
- Posts
- 3
Guys this is realy important for me....So please help ....i will be more than thankful to you!!!!!!!!!
- 12-24-2008 #3
Well, not many of us are likely to just hang around waiting for programming tasks to do; we have our own! ;)
But we're usually willing to help with specific questions, because a few minutes of our time goes a long way in getting others unstuck.
So pick your language of choice, write a script or other program, and see whether it works. If it doesn't, post a reasonably short test program here, along with reasonably short test data, and tell us how you expected it to work and what (exactly what) it did instead.
Good luck!--
Bill
Old age and treachery will overcome youth and skill.
- 12-25-2008 #4Just Joined!
- Join Date
- Dec 2008
- Posts
- 3
Thanks for response Sir!!! ...but i am new to shell script. I have explained my INPUT and desired OUTPUT above. It would be a great if you can help me in acheiving above output or if you can atleast provide an idea how to do so....
- 12-25-2008 #5
Are there any language restrictions? Is the input HTML, XML, what?
If it's X(HT)?ML, it should be very simple to use an XML parser to extract the <p> tags. Otherwise, you'll probably need to do some regular expression magic.
But yes, as wje says, don't expect to come in and ask us to write a program for you. If you truly have no idea how to start, maybe a good guide to shell scripting would be a good first step.DISTRO=Arch
Registered Linux User #388732
- 12-25-2008 #6Well said. You might want to google (or better, scroogle) the following search terms to find something that suits you:maybe a good guide to shell scripting would be a good first step.
When you are finished with that, or even while you're working your way through it, you may wish to acquaint yourself with a scripting language liike Perl, python, or ruby.Code:bash tutorial
At this point in the thread is where everyone should now pile on top of each other and say:
Perl!
No! python!
No! ruby!
And so forth.
I'm sure any of them will work, but of course Perl is best. (* ducks and runs*)--
Bill
Old age and treachery will overcome youth and skill.
- 12-25-2008 #7
Oh, wait. I forgot. You really want to learn lisp. (Just kidding, maybe.)
--
Bill
Old age and treachery will overcome youth and skill.


Reply With Quote