2

I have a text file containing a memory dump from an embedded system, which I update after every run (the file is formatted in the Motorola SREC format, but this is not too important). I am using Excel to parse the file to meaningful values and verify the results.

Currently, I open the file in a text editor, select all, copy, then paste into a specified area in the spreadsheet. The formulas in the spreadsheet take care of the rest.

I want to skip the stage of the text editor. What I would like to have is a way to embed (or, more correctly, link) the file contents in the specified cell(s), and let Excel update the fields automatically when the dump file changes (or, at least, update upon a key-press).

Is there a way to do that?

Note: I know it can also be done with Data/Get External Data/From File, but this is not an automatic process either.

0

2 Answers 2

3

After some further Googling with a more exact search phrase, I found this link which points to the answer.

  1. Select the cell where the first line of text from the file should be.

  2. Use the Data/Get External Data/From File dialog to select the text file to import.

  3. Format the imported text as required.

  4. In the Import Data dialog that opens, click on Properties...

  5. Uncheck the Prompt for file name on refresh box.

  6. Whenever the external file changes, click the Data/Get External Data/Refresh All button.

1
  • not as versatile as a Macro, but definitely a lot easier to implement Mar 20, 2014 at 20:27
1

Yes, bind a VBA Macro to a button for example and make it import your files content into the area you need it in. Maybe you can hardcode the filename in your case instead of popping up a fileOpen Dialogue. To trigger it on a file change might be more difficult. You also have the option to do all kinds of stuff to it first that way if you needed to.

Here is the importing (and important) part: https://stackoverflow.com/questions/11267459/vba-importing-text-file-into-excel-sheet

2
  • Thanks. please see my self answer. I think it is a much simpler solution.
    – ysap
    Mar 20, 2014 at 20:23
  • Yes, see my comment to your self answer ;-) Mar 20, 2014 at 20:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .