I need to create a tab delimited file from a cursor. Normally I would only use COPY TO but in this case I need a header row that COPY TO doesn't create.
I thought you could use? along with CHR (9) but does not put a TAB in the file. I opened the file with notepad ++ and word with show special characters activated. I expected to see the right arrow for TAB but it wasn't there. The file looked more like a fixed width format
Here is my code
LOCAL lcWBSIncFile, lcEACIncHeader lcEACIncHeader = "EarnedValue" + CRLF +; "ContrName" + CHR(9) + ; "StruName" + CHR(9) + ; "WbsNum" + CHR(9) + ; "EndDate" + CHR(9) + ; "UnitName" + CHR(9) + ; "UnitScale" + CHR(9) + ; "LRE" lcWBSIncFile = RTRIM(vpcProgram) + "_" + dtoc(vpdStatusDate,1) + "_" + TTOC(DATETIME(),1) + "_WBS_EAC.inc" SET ALTERNATE TO ( lcWBSIncFile ) SET ALTER ON SET CONSOLE OFF ? lcEACIncHeader SELECT _csrEACUpdateWBSFinal SCAN ? contrname + CHR(9) ?? struname + CHR(9) ?? wbsnum+ CHR(9) ?? enddate + CHR(9) ?? unitname + CHR(9) ?? unitscale + CHR(9) ?? ALLT(STR(lre,24,2 )) ENDSCAN SET ALTERNATE TO SET ALTERNATE OFF
COPY TO (file name) TYPE DELIMITED WITH TAB works fine, I just don't get a header.