473,385 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to extract the abbreviation from a given text uisng PERL

12
Hi everyone,
I am a newbie in Perl.
I would like to know how to extract the abbreviation from a given text using Perl.

For example,
Dr. Alex is a very smart doctor. He is from USA.

Then my output will be
Dr.
USA

Thank you.
Mar 22 '08 #1
4 1573
eWish
971 Expert 512MB
Are you looking to capture ALL abbreviations or just certain ones? If you just have a few then you could use a regular expression or ternary operator for this.

Otherwise, I would suggest that you look at CPAN.

--Kevin
Mar 22 '08 #2
phoenie
12
Are you looking to capture ALL abbreviations or just certain ones? If you just have a few then you could use a regular expression or ternary operator for this.

Otherwise, I would suggest that you look at CPAN.

--Kevin
i want to get all abbreviations....
really thanx a lot...
i will take a look on CPAN
Mar 22 '08 #3
phoenie
12
Are you looking to capture ALL abbreviations or just certain ones? If you just have a few then you could use a regular expression or ternary operator for this.

Otherwise, I would suggest that you look at CPAN.

--Kevin
Hi,I am back.Really sorry. Even though i already took one day to look for CPAN.
I still cant figure out the solution. Can you help me a bit more?
Mar 23 '08 #4
eWish
971 Expert 512MB
What you are wanting to do is really an undertaking. Take this list of abbreviations for example. It would not be a simple task to build an efficient script to search your text file for a word that matched any of the ones on the list. In my opinion this is where a database would be your friend.

On the other hand if you wanted to only look for a few say 30 or so then you could use a hash. Which would be much easier.

Essentially, what you want to do is read the file and split on the whitespace and loop through each for and see if it matches any of the words of your abbreviations list. Have you written any code at this point?

--Kevin
Mar 23 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: kaykay90 | last post by:
Hi , I have been asked to send mails using Lotus Notes Modules.I tried to extract Lotus Notes modules in PERL for Sending the mails.I have been succeded in saving the mail as draft,but could not...
1
by: dangier | last post by:
I have an Access 2003 table with an XML field that is tagged as follows: <Calendar CompactMode="1"><CustomProperties><CustomProperty Name="startdate" Value="3/26/2007"...
2
by: kkazakos | last post by:
Hello, I am a newbie in perl and i have the following problem. I have as input a text file in the following format:...
0
by: ehasas | last post by:
Hello, I am trying to retrieve Xpath from the XML file for a given text value of node. I am doing this in VB and using "Microsoft XML, v4.0" library for XML parsing. How to find xpath from the...
3
by: f6600840 | last post by:
Hi, What function I should use if I want to clean text using perl. Example. Input for my perl based shell command is SMI-1234 566.5.2.3.4.5.5.192.168.1.1 = "huuhaa" : SMI-1234...
4
by: =?ISO-8859-1?Q?Nordl=F6w?= | last post by:
How do I efficiently determine which possible encoding(s) a given text is in? Can I use the iconv.h api somehow? Thanks in advance, Nordlöw
0
by: =?ISO-8859-1?Q?J=F6rg_Battermann?= | last post by:
Hello there, Is there any -reliable- way to extract certain, given ranges in excel files into either a picture (each) or into proper xhtml? I am asking because I am currently automating a...
6
by: HypeBeast McStreetwear | last post by:
Hi I'm supposed to be writing a program that counts in a given text, the words that contain at least three different vowels (a,e,i,o,u) For my test run I have to use "unquestionably", but I can't...
4
by: saumalatha | last post by:
someone please help me do this...how to extract the plain text from an xml file.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.