How to extract a sentences of word from a text file.
Hi ,
i have a text file that contain a story
How do i extract the out all the sentences that contain the word Mon. in C++
I only want to show those sentences that contain the word mon
eg.
Monkey on a tree.
Rabbit jumping around the tree.
I am very rich, I have lots of money.
Today is monday.
tomorrow is tuesday.
but only those words that contain the word mon is show.
Monkey on a tree
<Press enter to continue or q to quit>
I have lots of money
<Press enter to continue or q to quit>
Today is monday
<Press enter to continue or q to quit>
any advices on that
below is my codes, but it come out as a chunk of word that i search for.
This sounds like homework, but since you have actually posted some working code, I'll give you the benefit of the doubt.
You must concatenate s until you find an end-of-sentence delimiter. An end-of-sentence delimiter should look like one of: ". ", "! ", "? ". So first, you do a find for each of these strings, and if not sound, you concatenate the entire line to s. When you do find one, you split the line, concatenating the first part to s, and leaving the remainder for the next sentence (new variable). Then you search s for your target string. Then you replace s with the remainder of the sentence, and continue your loop.
Hi
I have two text files. The first file is TEXTFILEONE.txt as given below:
<Text Text_ID="10155645315851111_10155645333076543" From="460350337461111" Created="2011-03-16T17:05:37+0000" use_count="123">This is the first text</Text>
<Text Text_ID="10155645315851111_10155645317023456"... (7 Replies)
Hi
I have a big text file. I want to extract all the sentences that matches at least 70% (seventy percent) of the words from each sentence based on a word list called A.
Say the format of the text file is as given below:
This is the first sentence which consists of fifteen words... (4 Replies)
Hi
I have two lists of patterns named A and B consisting of around 200 entries in each and I want to extract all the sentences from a big text file which match atleast one pattern from both A and B.
For example, pattern list A consists of :
ama
ani
ahum
mari
...
...
and pattern... (1 Reply)
Hello, I need some help extracting the number after the RBA e.g 15911688 from the below block of text (e.g: grep RBA |sed .......). The code should be valid for blocks if text generated at different times as well and not for the below text only.
... (2 Replies)
Hi i want to extract the word present before .txt in the text file.
For example,
Sample_ab_a.txt ----------> i need 'a'
Sample_abc_b.txt -----------> i need 'b'
Can anyone help me in getting the word extracted (5 Replies)
FOLKS ,
i have a text file that is generated automatically of an another korn shell script, i want to bring in the fifth line of the text file in to my korn shell script and look for a particular word in the line . Can you all share some thoughts on this one.
thanks...
Venu (3 Replies)
Just wondering if there's a better way to get these complete sentences into an array and keep the quotes intact? All the quotes make it look ugly to me but it works. I want to be able to refer to the full sentences by index. I've tried a few qw and qq/ aproaches but what I have below seems about... (4 Replies)
Hi guys,i got this problem which is..i need to find those sentences with date inside and extract them out,the input is somehow like this
eg:
$DATA42.GANTRY2.GA161147 DISKFILE 2007-10-16 11:56:45 SUPER.OPR \NETS.$Y4CB.#IN
... (4 Replies)