Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     CSV without Double Quotes

Read-Only Read-Only Topic
Go
Search
Notify
Tools
CSV without Double Quotes
 Login/Join
 
Member
posted
Hi,

I have been trying to find out if there is a way to generate a CSV report without double quotes around the text fields. I am trying to generate a report that I can load directly to another database via a web portal and am trying to avoid having to open each file and re-format it after it's been generated.

I am using Developer Studio 7702

Thanks in advance for your help.
 
Posts: 5 | Registered: May 24, 2012Report This Post
Expert
posted Hide Post
you could just generate a .txt file output
[ON TABLE HOLD FORMAT ALPHA]
and having FILEDEF'd it as FILEDEF THING DISK C:/..../THING.TXT

and create your own string, inserting a comma after every field,
TABLE FILE CAR
SUM SALES BY COUNTRY BY CAR ON TABLE HOLD FORMAT ALPHA
END
-RUN
DEFINE FILE HOLD
output/A100=SALES ||','||COUNTRY ||','||CAR ;
END
TABLE FILE HOLD PRINT output
ON TABLE HOLD AS THING FORMAT ALPHA
END
-- that sort of thing




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
This gives you a comma delimited output without quotes.
TABLE FILE CAR
PRINT
  DEALER_COST
BY COUNTRY
BY CAR
ON TABLE HOLD FORMAT DFIX DELIMITER ,  
END


WF 7.7.04, WF 8.0.7, Win7, Win8, Linux, UNIX, Excel, PDF
 
Posts: 175 | Location: Pomona, NY | Registered: August 06, 2003Report This Post
Expert
posted Hide Post
brilliant. alex to the rescue!




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
Thanks very much for the tips - very helpful.
 
Posts: 5 | Registered: May 24, 2012Report This Post
Silver Member
posted Hide Post
Building on Alex's solution:
ON TABLE HOLD FORMAT ...
DFIX DELIMITER delim [ENCLOSURE enclose] [HEADER header] [PRESERVESPACE spaces]..delimited file
delim: TAB .... to create tab-delimited data
delim: characters .... up to 30 characters as delimiters
delim: hex-value .... value for non-printable characters
enclose: character .... up to four printable characters to enclose the data
enclose: '''' .... four single quotes produces a single quote
header: NO .... [default] no title line is included
header: YES .... a title line with fieldnames is included
spaces: NO .... [default] leading and trailing blank spaces are removed from output
spaces: YES .... leading and trailing blank spaces are left in output
The spaces option was added in 7.7.04
From the WebFOCUS Keysheet, around page 59.



WebFOCUS 8.0.2, FOCUS since 1977 - John@Aviter.com
PDF , Excel, FOCUS, Author of the Keysheets and Dates book.
www.Aviter.com
 
Posts: 40 | Registered: April 19, 2013Report This Post
Member
posted Hide Post
Wow, all of this has been really helpful. I've scoured around looking for tidbits like this before posting here. It's amazing how now knowing a small bit of code has such a big impact. Thanks all!
 
Posts: 5 | Registered: May 24, 2012Report This Post
Member
posted Hide Post
I think I celebrated too soon.

The DFIX works great so long as I run it locally. As soon as I run the procedure through report caster, I get the double quotes again. I've tried different output formats - DFIX, .CSV (which is what the file is supposed to be), ALPHA, COMT. All come out with quotes or lack any formatting. So I am stuck again. I wish there was a way to run the report without having to specify a report output format.
 
Posts: 5 | Registered: May 24, 2012Report This Post
Expert
posted Hide Post
really? that's a bug! gotta be.
well, go back and do it the hard way...see my post above...
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
What I don't understand is why you are required to get rid of the quotes when the standard for CSV actually makes provision for them to be used (what if you have a comma as part of your data?).

Whichever database or data load facility you're using should be able to read your CSV file, quotes or no quotes ...



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
I set up a simple fex that creates a DFIX file. I then created a ReportCaster schedule to execute this fex and selected DFIX as Report Format and "test.csv" as file name. I receive an email with an attachment called test.csv. I see no double quotes when I open it in a text editor.

TABLE FILE CAR
PRINT SALES
BY COUNTRY
BY CAR
BY MODEL

ON TABLE PCHOLD AS FMH001 FORMAT DFIX DELIMITER ,
END

ENGLAND,JAGUAR,V12XKE AUTO,0
ENGLAND,JAGUAR,XJ12L AUTO,12000
ENGLAND,JENSEN,INTERCEPTOR III,0
ENGLAND,TRIUMPH,TR7,0
FRANCE,PEUGEOT,504 4 DOOR,0
ITALY,ALFA ROMEO,2000 4 DOOR BERLINA,4800


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
quote:
Originally posted by Francis Mariani:
I set up a simple fex that creates a DFIX file. I then created a ReportCaster schedule to execute this fex and selected DFIX as Report Format and "test.csv" as file name. I receive an email with an attachment called test.csv. I see no double quotes when I open it in a text editor.

TABLE FILE CAR
PRINT SALES
BY COUNTRY
BY CAR
BY MODEL

ON TABLE PCHOLD AS FMH001 FORMAT DFIX DELIMITER ,
END

ENGLAND,JAGUAR,V12XKE AUTO,0
ENGLAND,JAGUAR,XJ12L AUTO,12000
ENGLAND,JENSEN,INTERCEPTOR III,0
ENGLAND,TRIUMPH,TR7,0
FRANCE,PEUGEOT,504 4 DOOR,0
ITALY,ALFA ROMEO,2000 4 DOOR BERLINA,4800


I'd like to add one thing about DFIX, with the HEADER ON option, the headers are always in CAPS which appears to be a bug


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 1 | Registered: October 27, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     CSV without Double Quotes

Copyright © 1996-2020 Information Builders