Focal Point
How to create a free-format comma-delimited text file?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4231093491

November 02, 2006, 12:09 PM
Jeeva
How to create a free-format comma-delimited text file?
I am trying to create a free-format comma-delimited text file. I need all fields separated by comma but no double quotes around the fields. I also need comma-dollar sign character combination(,$) to terminate the record.
Any idea how to do this?
My sample code below:
TABLE FILE COURSE
SUM
EMAIL
CSF_FACULTY
BY
CSF_FACULTY NOPRINT
ON TABLE NOTOTAL
ON TABLE SAVE FILENAME 'C:\temp\AddrList' FORMAT COM
ON TABLE SET PCOMMA ON
END

The above code will generate comma-delimited text file but it has double quotes around each field and no “,$” combination at the end of the line.
Any help would be appreciated.

Thanks,
Jeeva


Production WebFOCUS 7.6.2, Platform Win2003, Database Oracle 10g
November 02, 2006, 12:26 PM
Jim_at_LM
A quick way: just imbed your own delimiters between selected fields with a terminatior: ,$

DEFINE FILE CAR
CM/A1=',' ;
TERM/A21=',$' ;
END
TABLE FILE CAR
PRINT COUNTRY CM CAR CM MODEL TERM
ON TABLE SAVE AS 'MYFILE'
END


WebFOCUS 7.6.11, WINDOWS, HTML, PDF, EXCEL
November 02, 2006, 12:31 PM
Francis Mariani
FILEDEF HOLD01 DISK C:\TEMP\HOLD01.CSV
TABLE FILE CAR
PRINT
COMPUTE LINE/A60=
COUNTRY || ',' || CAR || ',' || MODEL || ',$';
BY COUNTRY NOPRINT
ON TABLE HOLD AS HOLD01 FORMAT TAB
ON TABLE SET HOLDLIST PRINTONLY
END


All trailing blanks are stripped from alpha [An] fields in a TAB hold file.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 02, 2006, 01:39 PM
Jeeva
Jim and Francis, Thank you to both of you.


Production WebFOCUS 7.6.2, Platform Win2003, Database Oracle 10g