Please help: Extract filtered output from following input


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Please help: Extract filtered output from following input
# 1  
Old 12-23-2008
Please help: Extract filtered output from following 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&mdash;similar to the feature detectors found in the visual cortex&mdash;that have special sensitivity to certain features of sound (Pickles, 1988). 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="https://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&mdash;similar to the feature detectors found in the visual cortex&mdash;that have special sensitivity to certain features of sound (Pickles, 1988). 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="https://www.unix.com/images/a_img_0.jpg" >


Thanks a Ton!!!

Last edited by parshant_bvcoe; 12-23-2008 at 01:38 PM..
# 2  
Old 12-24-2008
Guys ..!!!! this is really important for me....please help me in getting above output.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash to extract file prefix and from input to use in output

In the bash below which does execute I am trying to extract the contents of ${id} is 1234, as ${id} stores the variable that changes each time. After the path is removed the contents of ${id} are stored in pref, so they can be used in the output. Currently I am not able to extract the 1234 in the... (6 Replies)
Discussion started by: cmccabe
6 Replies

2. Shell Programming and Scripting

Content should be filtered within brackets

Hello all, I have a string and would like to extract the content of the text within the brackets. Here is the string: Desc="file from to line" What I would like to have is the following: Filename="4009821_737498.out" FromLine=12965 ToLine=12355 Maybe I have to do this with... (6 Replies)
Discussion started by: API
6 Replies

3. UNIX for Dummies Questions & Answers

Need to extract name from input

:confused:Hi All, I have created a common shell scripts which accepts 1 input variable which has the name of the datafile(v3_pcr2ecm_wkly_mainbase_maps_20120228.txt) and this name of the datafile keeps changing. I need to remove .txt extension and create a new log file as... (2 Replies)
Discussion started by: abhi_123
2 Replies

4. Shell Programming and Scripting

Extract the lines from input file

This is the sample input file b 05/Jul/2010:07:00:10 a 05/Jul/2010:06:00:10 b 05/Jul/2010:07:00:10 c 05/Jul/2010:07:10:10 d 05/Jul/2010:08:00:10 e 05/Jul/2010:09:00:10 f 05/Jul/2010:10:00:10 h 05/Jul/2010:11:00:10 i 05/Jul/2010:12:00:10 j ... (9 Replies)
Discussion started by: sandy1028
9 Replies

5. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

6. Shell Programming and Scripting

Mailing files with, ls filtered with grep

Hi guys Im new to forum so please dont be hard to me if I make any mistakes :) I want to the following task: 1. I have a file lets say file1, which contains job names with numbers which have failed to start and .... I can sort that file into another to get only the Job numbers with... (3 Replies)
Discussion started by: kl1ngac1k
3 Replies

7. Shell Programming and Scripting

To extract <P> tags in a custom manner from below mentioned 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... (2 Replies)
Discussion started by: parshant_bvcoe
2 Replies

8. UNIX for Dummies Questions & Answers

extract a part of a path like (input: /etc/exp/home/bin ====> output: exp)

Hi, I need to make some extraction . with the following input to get the right output. input: /etc/exp/home/bin ====> output: exp and input: aex1234 ===> output: ex Thanks for your help, (4 Replies)
Discussion started by: yeclota
4 Replies

9. Shell Programming and Scripting

extract/select pattern from input

Hey, examples of the input (text line): /bla/blMOasdn234.adanif24/blabla.rar /bla/blMOasdn234.adanif24/blabla23124.bin /bla/bla/bla/bla/bla/bla.bin and what I need to do is extract/select only the dir path so the output would be: /bla/blMOasdn234.adanif24/ /bla/blMOasdn234.adanif24/... (4 Replies)
Discussion started by: TehOne
4 Replies

10. UNIX for Dummies Questions & Answers

Filtered Print Que

I'm a new support employee and 1 of my sites is having a problem printing. There is a UnixWare 2.0 server and a HPLJ printer connect by TCP/IP. When a user prints something it usually prints but the job stays on the que for a while after it has been printed. When I check 'lpstat -t' the job is... (2 Replies)
Discussion started by: cparks
2 Replies
Login or Register to Ask a Question