How to import and export text from a game?

Is possible to export data text or number from a game to a txt or a excel table and, in real time or not, edit this information and resend for the game to refresh?

I need to import numbers from excel to determine colors to the 3d cube. If I put 3 the color of cube is red, if I put 2 is blue … but I need connect this numbers with a external data. Is possible?

It is not 100 clear your question, but if you want export/import from Excel, this is totally possible.

The best way to export is using CSV format in Excel and then read the file from Blender python. To export from Blender, you can write using file class an ASCII file with the values separated by commas, and then import in Excel.