How to extract numbers in a PDF file?

6 vues (au cours des 30 derniers jours)
Kwangho Cheong
Kwangho Cheong le 4 Mar 2022
Modifié(e) : Ronak Panchal le 10 Mai 2022
I'm trying to extract numbers in a PDF file using extractFileText function. It returns string format data by reading a PDF file; however, the string data is not relevant for extracting numbers since the numbers are stuck together.
Let me show an example.
This is what I want to extract:
What I get is as follow:
Norm106.1696.589.589.92>102,17.5Sel58.5459.09-0.55-0.57NA0,-0.5Max106.1698.557.617.88
But when I copied the text by the ctrl+c in the PDF file, I got the result like this:
Norm Sel Max
106.16 58.54 106.16
58.73 96.58 59.09 98.55
9.58 -0.55 7.61
I'd like to separate the numbers in the string data or import text with spaces, at least.
What is the best way in this case?

Réponses (1)

Ronak Panchal
Ronak Panchal le 10 Mai 2022
Modifié(e) : Ronak Panchal le 10 Mai 2022
You can use the function split() to split your output data
For eg:
Data = extractBetween ();
This gave me an output:
USEPoint#Cut↵↵[%]
a = split(Data);
Ouput:

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by