How can I print a tab key to export text information to a spreadsheet software (e.g.Excel)?


If you are printing your data to the output window the tab will be removed and replaced by 2 blanks. To keep the tab (t) you can print directly to a file (e.g. csv)

Here is a small piece of sample code:

double dNum1, dNum2;
int iFile;
iFile = 1;
dNum1 = 1.234;
dNum2 = 3.456;
fopen('c:\\temp\excel.csv', w, iFile); ! path, mode, file handle
fprintf(iFile, '%10.3f \t %10.3f' ,dNum1, dNum2); ! file handle, format, values
fclose(iFile); ! file handle