Focal Point
[SOLVED] Space Between Every Character

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

June 02, 2009, 05:07 PM
dikanst
[SOLVED] Space Between Every Character
I am trying to extract data from a CSV file which is TAB delimited, and I am using SUFFIX=TABT in the MAS file. For some reason, a space is being added between every character in the fields. Eventhough the actual field is 8 charcters long, I would have to change it to 17 to avoid the "data field larger than specified length" error.

Ex:
a DATE field in CSV file: "20090401"
DATE field outputed: " 2 0 0 9 0 4 0 1 "

Has anyone encountered this before?

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


WebFOCUS 7.6.7
Windows Server 2003
June 02, 2009, 05:28 PM
Doug
I don't get it. Is this a tab delimited or a CSV file? It can't be both, can it?
June 02, 2009, 05:37 PM
Waz
Can you post the master ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 02, 2009, 05:38 PM
dikanst
I think that is the problem. I don't know how, but the CSV file is tab delimited. When I open it up in notepad, it really is delimited with tabs.


WebFOCUS 7.6.7
Windows Server 2003
June 02, 2009, 05:44 PM
dikanst
Here is part of the master:
FILENAME=STISADVPORT, SUFFIX=TABT, $
SEGNAME=STISADVPORT, $
FIELD=EXTRACTDATE ,EXTDATE , A17 , A17 , MISSING=ON ,$
FIELD=PORTFOLIO_ID,PORTID  , A13 , A13 , MISSING=OFF,$ 


Here is how the master should look according to the CSV file:
  
FILENAME=STISADVPORT, SUFFIX=TABT, $
SEGNAME=STISADVPORT, $
FIELD=EXTRACTDATE ,EXTDATE , YYMD, A8 , MISSING=ON ,$
FIELD=PORTFOLIO_ID,PORTID  , A6 , A6 , MISSING=OFF,$ 



WebFOCUS 7.6.7
Windows Server 2003
June 02, 2009, 05:47 PM
Waz
Where does the data come from ?

Could it be unicode ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 02, 2009, 06:19 PM
Doug
Please read up on "SUFFIX" and the associated values associated with it in regards to CSV files. These masters (in the Tue Jun 02 2009 17:44 post) are for a tab delimited file.
June 02, 2009, 06:34 PM
Waz
quote:
I am trying to extract data from a CSV file which is TAB delimited


Doug, I think the file is Tab delimited.

dikanst, can you post some data ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 02, 2009, 07:24 PM
Doug
Yeah Waz, Therein lies the first dilemma: "I am trying to extract data from a CSV file which is TAB delimited" ... "but the CSV file is tab delimited". So, it's not a CSV file... Let's wait for some data.
June 02, 2009, 07:48 PM
Waz
Doug, I completely agree that the terminology is wrong, Tab delimited is Tab Delimited. Calling it CSV can be misleading.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 02, 2009, 10:33 PM
Waz
Are you able to open the csv up in something other than notepad, say a hex editor, to see the actual contects of the file ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 03, 2009, 02:08 AM
<JG>
The fact that the output contains a space between each character is very strange however what is also strange is that (if you wrote it accurately) the output shows double quotes as part of the output.

This is incorrect for a TABT file as data elements should not be wrapped within double quotes.

What you have in WebFOCUS terms is a DFIX format file.

Write your master as DFIX and you will probabley find that it works.
You can find out how to write it in the dev studio online help
June 03, 2009, 03:54 AM
GamP
I have seen this before. Reason in that particular case was that the text (or csv or tab delimited) file originated from a system that used a somewhat different text encoding scheme. In my case it was a unnicode enabled ms sql server 2005 system, that produced a file suited for unicode access. Which uses two bytes for every character. I had to use some file conversion program to get it right.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
June 03, 2009, 10:43 AM
dikanst
Thanks guys, I guess there's just something wrong with the format of the data. I converted it to a normal tab delimited text file, and everything works correctly.


WebFOCUS 7.6.7
Windows Server 2003