finding the string from the text file

45 vues (au cours des 30 derniers jours)
msp
msp le 18 Avr 2013
Commenté : Mira Mamdouh le 23 Déc 2019
i want to find the string from the given text file.
Example file contains : Hello welcome matlab tutorial.
if input is matlab, it should search the word(string) from the file if matched out put should string present in file else string doesn't present in the file.
  2 commentaires
msp
msp le 18 Avr 2013
Please Help Me with source code
Cedric
Cedric le 18 Avr 2013
Modifié(e) : Cedric le 18 Avr 2013
Here is the best help that I can provide you with, accounting for your other questions:
In the "MATLAB" section, you will find the following documents:
  • PDF labeled "MATLAB Primer".
  • PDF labeled "Mathematics".
  • PDF labeled "Programming Fundamentals".
After reading these and training so you have a fair understanding of the material, you'll be able to do much more by yourself without asking for "(complete) source code".

Connectez-vous pour commenter.

Réponses (3)

Matt Kindig
Matt Kindig le 18 Avr 2013
To get you started, look at the documentation for the following functions:
doc strfind %to find whether a string is present
doc fileread %to read a text file all at once into a variable

Mahdi
Mahdi le 18 Avr 2013
Modifié(e) : Mahdi le 18 Avr 2013
A=fileread(filename)
B=strfind(A, WordString)
I would suggest looking at the strfind() function for more information.
  1 commentaire
Mira Mamdouh
Mira Mamdouh le 23 Déc 2019
does it work properly if the microsoft file contains macros ?

Connectez-vous pour commenter.


msp
msp le 18 Avr 2013
any source code available?
  1 commentaire
Matt Kindig
Matt Kindig le 18 Avr 2013
Mahdi and I just gave you functions to get you started. What further source code do you need? Keep in mind that this forum will not simply write code for you (especially because this seems a lot like homework).

Connectez-vous pour commenter.

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