T O P I C R E V I E W |
Scomex |
Posted - 03/04/2013 : 11:19:22 AM Origin Ver. and Service Release (Select Help-->About Origin): Origin 8.0.63.988 SR6 (8.0988) Operating System: Windows 7
Hi, My aim is to import several txt files into a work book and then set the path and name of these files as comments into this workbook.
wksPg.Create(); wks0=wksPg.Layers(0); char str_comments[10000]; ASCIMP ai1, ai2; int nbfiles; StringArray icspath; nbfiles = GetMultiOpenBox(icspath, "*.txt"); if(nbfiles>0) { printf("%d files :\n",nbfiles); for(index =0; index<nbfiles; index++) { if(AscImpReadFileStruct(icspath[index], &ai1)==0) { strcat(str_comments, icspath[index]+"\n"); ai1.iMode = ASCIMP_MODE_APPEND_COLS; ai1.iRenameCols = 0; wks0.ImportASCII(icspath[index], ai1); wks0.AutoSize(); } wksPg.SetComments(str_comments); } } else { printf("no file !"); }
The problem is that even if I write "\n" in the string concatenation, the final comment is on a single line. For easier reading, I would rather have a new line for each string containing the filename. Another thing is that the workbook and the worksheet get the name of the final imported file and I don't know how to keep a constant worksheet name. |
1 L A T E S T R E P L I E S (Newest First) |
Penn |
Posted - 03/04/2013 : 9:09:47 PM Hi,
1. Please use "\r\n" instead to display as a new line.
2. See ASCIMP structure, need to set iRenameWks to 1, such as
ai1.iRenameWks = 0;
Penn |
|
|