Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SHARING] - Remove Trailing Spaces from text output (Unicode UTF-8)
Go
New
Search
Notify
Tools
Reply
  
[SHARING] - Remove Trailing Spaces from text output (Unicode UTF-8)
 Login/Join
 
Member
posted
Hi all,

Just thought I would again share a very simple solution that I'm sure most of you know but is not well documented. Hopefully this is not a piece of useless information.

The issue was that we have a requirement to output data to a text file and ensure that there are x number of spaces at the end of each row.

The row in the Oracle Database is set to A2000V however the maximum length in the row is 130 Characters with spaces after that.

The text file output required was that the end of the row had 8 trailing spaces.
If using a codepage like 1252 then you can set a define field to A138 and the output is fine.

However if using UNICODE the multiplication factor that accounts for the maximum of 3 Bytes will basically triple the space which in our case was adding 200+ spaces in the text file. (Even though it's not really space but bytes)

Anyway what we had to do was stipulate to WebFOCUS the number of bytes to display.
This was done by changing the define field from

DEFINE FILE REPORT_DATA
DF_MERGE_COLUMN/A138 = MERGE_COLUMN

to

DEFINE FILE REPORT_DATA
DF_MERGE_COLUMN/A138B = MERGE_COLUMN

Adding the B at the end of the field length in the define allowed us to have a text file with the correct number of spaces.


WebFOCUS 8203M
O/S Windows 7
 
Posts: 7 | Registered: August 02, 2017Reply With QuoteReport This Post
Gold member
posted Hide Post
Cool,
Thanks for sharing

Nice Thread


WF 8.2.04
Windows/Unix
All Formats
In Focus since 2006
 
Posts: 74 | Location: UK | Registered: September 17, 2018Reply With QuoteReport This Post
Gold member
posted Hide Post
I didn't know that, but wish I had; thank you!


WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
 
Posts: 86 | Location: MI | Registered: July 23, 2009Reply With QuoteReport This Post
Gold member
posted Hide Post
However, when I do get a multibyte character in one of my fields, if I use this approach, my field ends up being too narrow, and my next field starts early.

If anybody has a solution to that, I'd love to hear it! One could convert all multibyte characters to ASCII characters at the outset, but that seems uneccessary in 2019. . .


WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
 
Posts: 86 | Location: MI | Registered: July 23, 2009Reply With QuoteReport This Post
Member
posted Hide Post
Can you give me an example of how your data is structured? Specifically where your Multibyte character is.
I haven’t tried this with a blend of ASCII and Multibyte but as we output Chinese Characters I can quite easily create a data source that does this.


WebFOCUS 8203M
O/S Windows 7
 
Posts: 7 | Registered: August 02, 2017Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SHARING] - Remove Trailing Spaces from text output (Unicode UTF-8)

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.