LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search letter occurance a document

Hi guys

 

 

I am trying to  count the letter occurance in a document, say a PDF or word.  Say A occurance in the document.  And also count the amount of letters in a document   in the document and output the letter i counted to a new documment.

 

 

Best Regards

 

Hammingcode

 

0 Kudos
Message 1 of 9
(3,086 Views)

What have you tried?

 

First you need to get the document into LabVIEW as a string.

 

Then I would consider converting the string to a U8 array.  Then I would do a histogram on that.  You would have the number of each byte value that exists in the document which would be the ASCII value of a particular character.

0 Kudos
Message 2 of 9
(3,081 Views)

I thoguht about that, but Labview string has limit size, if the document size is quite big. it is not possible to convert all letters into string

0 Kudos
Message 3 of 9
(3,077 Views)

If the dcoument is so large that all its text cannot be contained by one string, then you will need to read it in sections and add the character counts.

 

Lynn

0 Kudos
Message 4 of 9
(3,075 Views)

Are you serious about the 'string length' limit? A string is sizable upto U32, or 4 GB, so probably more than the amount of memory your OS is giving to any process.

 

Ton 

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 5 of 9
(3,070 Views)

You mean i need copy the contains of document and paste it in the Labview string?   Is there any subVi can read the contain of document to a string?

0 Kudos
Message 6 of 9
(3,064 Views)

It depends.  What is the source?  Is it .pdf for Word, the answer will be different for each.

 

I don't know about the .pdf.  For Word, you could use ActiveX functions to access the file and read the data.

0 Kudos
Message 7 of 9
(3,057 Views)

- How have you been getting on with this?  Do you have any other details?

 

I'd be interested in seeing how you could extract the text from a PDF file.  I have no doubt that it could be done, however you might need a dig a little through the construction of the PDF file.  Most of the tools which are available are for generation - for example the Report Generation Toolkit for MS applications or PDF toolkits from multiple 3rd party sources.


Regards,

Peter D

0 Kudos
Message 8 of 9
(3,027 Views)

If it is a PDF - this looks to be a useful document as a starting point.


Regards,

Peter D

0 Kudos
Message 9 of 9
(3,025 Views)