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     [SOLVED]Adding extra spaces with format comma

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Adding extra spaces with format comma
 Login/Join
 
Platinum Member
posted
When I output to html everything is working and formatted fine. But when I switch to output to a csv file, format comma, it seems to add extra spaces in some of my defines fields.

Here is the output to html:

TERM SITE_ID START_DATE TITLE COURSE_ID Descr PUBLISH END_DATE TEMPLATE 
Fall 2010 1108.12754 2010-08-23 AGRI 431 0089-1-INTERNATIONAL FOOD POLICY AGRI 431 0089-1 INTERNATIONAL FOOD POLICY 0 2010-12-17 template.webenhanced 
Fall 2010 1108.10929 2010-08-23 AGRI 438 0089-1-LAND RESOURCE MGMT PLANNING AGRI 438 0089-1 LAND RESOURCE MGMT PLANNING 0 2010-12-17 template.webenhanced 
Fall 2010 1108.10929 2010-08-23 AGRI 538 0089-1-LAND RESOURCE MGMT PLANNING AGRI 538 0089-1 LAND RESOURCE MGMT PLANNING 0 2010-12-17 template.webenhanced 
Fall 2010 1108.10493 2010-08-23 ART 131 0001-1-DRAWING I ART 131 0001-1 DRAWING I 0 2010-12-17 template.webenhanced 
Fall 2010 1108.10649 2010-08-23 ART 325 001-1-PRINTMAKING II ART 325 001-1 PRINTMAKING II 0 2010-12-17 template.webenhanced 
Fall 2010 1108.10666 2010-08-23 ART 339 0001-1-ART HISTORY SURVEY II ART 339 0001-1 ART HISTORY SURVEY II 0 2010-12-17 template.webenhanced 
Fall 2010 1108.11651 2010-08-23 BIOL 221 0079-1-BIOTERMINOLOGY BIOL 221 0079-1 BIOTERMINOLOGY 0 2010-12-17 template.webenhanced 
Fall 2010 1108.12902 2010-08-23 BIOL 458 0079-1-EVOLUTION BIOL 458 0079-1 EVOLUTION 0 2010-12-17 template.webenhanced 
  


Here is the output to comma:
"Fall 2010                                         ","1108.12754 ","2010-08-23","AGRI     431       0089-1-INTERNATIONAL FOOD POLICY       ","AGRI     431       0089-1  ","INTERNATIONAL FOOD POLICY     ","0","2010-12-17","template.webenhanced     "
"Fall 2010                                         ","1108.10929 ","2010-08-23","AGRI     438       0089-1-LAND RESOURCE MGMT PLANNING     ","AGRI     438       0089-1  ","LAND RESOURCE MGMT PLANNING   ","0","2010-12-17","template.webenhanced     "
"Fall 2010                                         ","1108.10929 ","2010-08-23","AGRI     538       0089-1-LAND RESOURCE MGMT PLANNING     ","AGRI     538       0089-1  ","LAND RESOURCE MGMT PLANNING   ","0","2010-12-17","template.webenhanced     "
"Fall 2010                                         ","1108.10493 ","2010-08-23","ART      131       0001-1-DRAWING I                       ","ART      131       0001-1  ","DRAWING I                     ","0","2010-12-17","template.webenhanced     "
"Fall 2010                                         ","1108.10649 ","2010-08-23","ART      325       001-1-PRINTMAKING II                   ","ART      325       001-1   ","PRINTMAKING II                ","0","2010-12-17","template.webenhanced     "
"Fall 2010                                         ","1108.10666 ","2010-08-23","ART      339       0001-1-ART HISTORY SURVEY II           ","ART      339       0001-1  ","ART HISTORY SURVEY II         ","0","2010-12-17","template.webenhanced     "
"Fall 2010                                         ","1108.11651 ","2010-08-23","BIOL     221       0079-1-BIOTERMINOLOGY                  ","BIOL     221       0079-1  ","BIOTERMINOLOGY                ","0","2010-12-17","template.webenhanced     "
"Fall 2010                                         ","1108.12902 ","2010-08-23","BIOL     458       0079-1-EVOLUTION                       ","BIOL     458       0079-1  ","EVOLUTION                     ","0","2010-12-17","template.webenhanced     "
 


In the html it lists AGRI 431 0089-1-International Food Policy nicely but in the format comma it puts extra spaces between the subject, course number and section number. Why?

Malinda

This message has been edited. Last edited by: Malinda,


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report This Post
Virtuoso
posted Hide Post
I'll bet those spaces are there in HTML as well, but when you display that in a browser, it automatically compresses all those blank spaces into a single space. However, when outputting to a CSV file, if you tell it there an A40 field, you're going to get 40 characters, whether or not most of them are spaces.

Is the subject course number and section number all one field in the database or are you creating that using concatenation?


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Platinum Member
posted Hide Post
Ah....true. The subject, course number and section number are all in separate fields in my db. In my define I only had a | separating the subject and course number. I switched this to a || and this only puts 1 space between them. My problem is that I actually don't want any spaces between the subject and course number but I do want 1 space between the course number and section number. Here is how I defined it:

 TITLE/A58=CSQASC_CLASS_TBL.CSQASC_CLASS_TBL.SUBJECT || CSQASC_CLASS_TBL.CSQASC_CLASS_TBL.CATALOG_NBR |' '| CSQASC_CLASS_TBL.CSQASC_CLASS_TBL.CLASS_SECTION ||'-'|| CSQASC_CLASS_TBL.CSQASC_CLASS_TBL.SESSION_CODE ||'-'|| CSQASC_CLASS_TBL.CSQASC_CLASS_TBL.DESCR;
 


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report This Post
Virtuoso
posted Hide Post
From documentation:
quote:
The following example shows how to use the SUBSTR function to extract the first initial from a first name, and then use both strong and weak concatenation to produce the last name, followed by a comma, followed by the first initial, followed by a period:

First_Init/A1 = SUBSTR (First_Name, 1, 1);
Name/A19 = Last_Name || (', ' | First_Init | '.');


This should give you some ideas.



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
Guru
posted Hide Post
Try using the SQEEZ Function.

SQCNAME/A38 = SQUEEZ(38, CASE_NAME, 'A38');


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Platinum Member
posted Hide Post
I did keep messing around with putting things into parenthesis and I think I got it to where I want it. Thanks!

Malinda


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 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     [SOLVED]Adding extra spaces with format comma

Copyright © 1996-2020 Information Builders