Fill editfield text value with string from a table
Show older comments
What I need to do is to read data from a csv like the one I have updated and then fill an edit field in app designer with what is written in that csv file.
As example i updated one with just a simple text in it.
I have tried with something like
DataComments = readtable('file7.csv');
app.CommentsEditField.value = DataComments
but it doesn't work.
Answers (1)
For this specific example, readlines might work better than readtable.
DataComments = readlines('file7.csv')
Then pick which one of these three strings you want to use to fill in your EditField. For example:
app.CommentsEditField.value = DataComments(2);
disp(app.CommentsEditField.value)
4 Comments
Massimo
on 9 Jun 2023
Les Beckham
on 9 Jun 2023
Edited: Les Beckham
on 12 Jun 2023
You are welcome.
Once you read the string from the text file, you can do whatever you like with it.
If the answer helped you solve your issue, I would appreciate it if you click "Accept this Answer". Thanks.
Massimo
on 12 Jun 2023
Les Beckham
on 12 Jun 2023
If you want help with that issue, you are going to need to provide your app designer code and any data needed to run it (or a stripped down version of it that illustrates the issue).
Categories
Find more on Text Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!