cancel
Showing results for 
Search instead for 
Did you mean: 

read text from a file

ab73
Associate II

Hi,

I would like to read text from a file csv and maybe display it, is it possible?

thanks

5 REPLIES 5

Yes.

The file would need to exist somewhere, be it an SD Card, eMMC or QSPI.

You'd need a file system, and a block driver. Something like FATFS or X-FILE

You'd need to read and parse the data in small amounts, or buffer and break into lines. Basic STDIO file handling type stuff, like on a PC application, but using f_open/f_read/f_close variants furnished by your file system

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
GaetanGodart
ST Employee

Hello @ab73 ,

 

Yes it is possible.

Just look at how to read a data file in C ("C read file" on Google).

From there you can fetch your data and display it on a textArea widget for instance.

Please find here our guide on how to display dynamic data on a textArea!

 

If this comment or another one answers your question, I invite you to select the most helpful comment as "best answer".

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

File IO seems like some that would need to be part of the TouchGFX builds or demos, given the value and foot-print of such a use case?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
GaetanGodart
ST Employee

Hello @ab73 ,

Have you been able to solve your problem?
If so, I invite you to select the most helpful comment as "best answer".

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)