This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to read data from a text file

Hi all,
i need to read data from a text file and write in keil µvision program.
How to open file, read, write and close file works in µvision programs.
Thanking you,

Parents Reply Children
  • "have your GUI create a C file (or header) with the correct data"

    Yes - I have already suggested that twice!

    "What we have here is a failure to Comunicate"

    Absolutely!
    There appear to be 3 issues here:

    1. The OP, by his own admission, is not an embedded developer, and knows nothing about embedded development;

    2. The OP, by his own admission, knows nothing about uVision - what it is, what it does nor how to use it;

    3. We are trying to discuss all this in a foreign language!

    None of this is a criticism of the OP - it just makes communication almost impossible!

    This is why I've suggested a couple of times that he gets his embedded developer(s) to describe what's going on - then they might be able to describe the real requirement, and we might be able to come up with a spec for the GUI that a VC developer could understand.

    As it stands, I'm still not convinced that the OP understands the difference between uVision & what it does on the PC, and the actual embedded application running on the target hardware - I'm not sure that he really wants compile-time configuration, rather than a run-time user interface...

    Maybe your fresh set of ears can understand him better than mine?

  • Hi ,
    sorry that i opened another thread,
    i wanted to say that i need to use Read, and write .txt,.xml files in C51 programs.
    Thanking you.

  • "i need to use Read, and write .txt,.xml files in C51 programs."

    Are we still talking about files created by your PC-based GUI?

    Remember: C51 programs run on 8051 processors in embedded hardware - they do not run on PCs!

    Therefore, before doing any file operations in a C51 program, you will have to implement a file system on the embedded target hardware!
    Part of implementing the file system will be to provide the necessary functions to read & write files.

    Once you have implemented your file system on your embedded target hardware, you will also have to figure out a way to get the files generated on your PC by your GUI from the PC and onto your embedded target hardware.

    I don't think you really want to do that, do you??!

    You still haven't said why you can't have your GUI generate a 'C' source file...