Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-19-2009, 01:47 AM   #1
LQ Newbie
Registered: Jan 2009
Posts: 2

Rep: Reputation: 0
Post stopword removal c++ query

I have written a code for removal of stopwords from a string but the problem is I want to remove stopwords from a text file which contains a huge amount of text.I want my code to read the text file line by line and then remove the stopwords from each line. I tried using fstream but I couldnt succeed in doing so.Plz I need help to do so.This is something tht I have done so far.


code snippet

#include <iostream>
#include <string>
using namespace std;

int main ()
{ string arr[3]={" a","an","the"};
string base_str;
size_t i;
int ans=0;
cout<<"\n enter a string::";

for(int j=0;j<3;j++)
i = base_str.find(arr[j]);
while(i != string::npos)

i = base_str.find(arr[j]);

return 0;

Old 01-19-2009, 01:59 AM   #2
Wim Sturkenboom
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
I'm not a C++ programmer so probably can not help you, but two comments

1) post the code that you have problems with and tell us what the exact problem is
2) use code tags around your code


c++, query, removal

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Synaptic: "removal" vs. "complete removal" newbiesforever Linux - Software 2 08-24-2008 09:31 PM
interesting MySQL query/view query :s mjh Programming 3 03-25-2008 08:30 AM
mysql use output of one query in another query secretlydead Programming 2 11-19-2007 02:25 AM
help with mysql query: return nth rows in query hawarden Programming 2 07-31-2006 07:36 PM
removal invinciblegod Linux - Laptop and Netbook 3 06-06-2005 04:47 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration