Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Count same words from a text file Post Reply Post New Topic
Author Message
rlassalle
Groupie
Groupie
Avatar

Joined: 09 Aug 2012
Online Status: Offline
Posts: 57
Quote rlassalle Replybullet Topic: Count same words from a text file
     Posted: 20 May 2014 at 5:31pm
Hi, I need to count each same words in a text file and show in the report each word and how many occurrence for each word. Can I use the split() to load the text file into an array and then how can identify and count the words?

thanks
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 21 May 2014 at 5:26am
Do you need to count certain words? or every single word?

If you need to count just certain words, you can use something like this

local numberVar count:= 0;
local stringVar name := Text;
Local numberVar strLen:=length(name);
local numberVar I;
for i:=1 to strLen do
    If Mid(name,i,1)= "Word"
        then count := count +1;
count
IP IP Logged
rlassalle
Groupie
Groupie
Avatar

Joined: 09 Aug 2012
Online Status: Offline
Posts: 57
Quote rlassalle Replybullet Posted: 21 May 2014 at 12:52pm
I need to cound every single word.
Thanks for answer me. I will try the one you send me to give the posibility to find one single word
 
Thank
 
Rodolfo
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum