I have text expressions something like as mentioned below. I want to filter only words with English alphabets (i.e no special chars, no operators, no quotes ...etc)
As an output, i expect words like this:
Input:
Buy 1 lakh SMS at 5p/SMS & Get 1lakh Data & keyword for 2 months free. Pay Rs.2000 more & Get a Dynamic 15 pages WebSite. Call 9811968238.
Output:
Buy lakh SMS at SMS Get lakh Data keyword for months free Pay Rs more Get Dynamic pages WebSite Call
QFile file("E:\\SMS\\dout.csv");
out << "This file is generated by Qt\n\n\n";
QFile file2
("E:\\SMS\\CCHECK.txt");
while(!chk_ln.isNull())
{
//Problem in below line
for (int i = 0; i < list2.size(); ++i)
{
out<<list2[i]<<" ";
}
out<<"\n";
chk_ln = cc_in.readLine();
}
QFile file("E:\\SMS\\dout.csv");
file.open(QIODevice::ReadWrite | QIODevice::Text);
QTextStream out(&file);
out << "This file is generated by Qt\n\n\n";
QFile file2("E:\\SMS\\CCHECK.txt");
file2.open(QIODevice::ReadWrite | QIODevice::Text);
QTextStream cc_in(&file2);
QString chk_ln = cc_in.readLine();
while(!chk_ln.isNull())
{
//Problem in below line
QStringList list2 = chk_ln.split(QRegExp("\\W+"), QString::SkipEmptyParts);
for (int i = 0; i < list2.size(); ++i)
{
out<<list2[i]<<" ";
}
out<<"\n";
chk_ln = cc_in.readLine();
}
To copy to clipboard, switch view to plain text mode
Any help is appreciated !!
Bookmarks