Focal Point
[SOLVED] (FOC209) Access to a .csv file

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

February 14, 2011, 03:01 AM
ChristianP
[SOLVED] (FOC209) Access to a .csv file
Hello,
i have a problem while trying to access a .csv file. i get the massage (FOC209) DATA VALUE EXCEEDS ITS LENGTH SPECIFICATION
i am trying to access a csv. file with two columns. Here is my master file and the fex code.

FILENAME=BASIS, SUFFIX=COM , $
SEGMENT=BASIS, SEGTYPE=S0, $
FIELDNAME=KU_NR, ALIAS=E01, USAGE=A10, ACTUAL=A10, $
FIELDNAME=KU_NAME, ALIAS=E02, USAGE=A300V, ACTUAL=A300V, $


FILEDEF BASIS DISK C:\10059441\BASIS.csv
TABLE FILE BASIS
PRINT
'BASIS.KU_NR'
'BASIS.KU_NAME'

END

Christian

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


WF Production Version: 7.7.02M
WF Test Version: 7.7.02M
Developer Studio: 7.7.02
HTML, EXL2K, FLEX, PDF,PPT
February 14, 2011, 03:06 AM
GamP
Usually this message means that one of the fields has a valuye that is longer than what's specified in the master.
But I have my doubts about the variable length format of the second field.
Steps I would take:
1. Give KU_NAME a non-variable format, like A300 and see if this resolves the issue.
2. Take a look at the csv file itself, using a text editor. It may be possible that it is actually not a comma separated file but semi-colon separated. If the source is Excel, this happens quite a lot and results in this situation.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
February 14, 2011, 03:37 AM
ChristianP
Hi GamP,
after replacing the semi-colon with comma i get the message that there are more values than fields in the mfd.
Christian


WF Production Version: 7.7.02M
WF Test Version: 7.7.02M
Developer Studio: 7.7.02
HTML, EXL2K, FLEX, PDF,PPT
February 14, 2011, 03:46 AM
Alan B
If the lines in the csv file do not end with a ,$ you need to SET PCOMMA=ON.

Also check that KU_NAME values do not contain a comma.


Alan.
WF 7.705/8.007
February 14, 2011, 03:48 AM
GamP
In that case, there has been one or more fields that originally contained a comma.
Because excel used a semi-colon to separate the fields, it did not take extra care to enclose fields that contain a comma in double quotes.
In this case it may even be best for you to go back to the orignal csv file and use a slightly different master file. Not command delimited but fixed delimited. You can specify the delimiter to be used. Suffix is DFIX, look it up in the doc.
Otherwise you'd have to look up all fields that have a comma, replace the comma by something else or enclose the field in " ", and then replace all ; by ,.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
February 14, 2011, 05:56 AM
ChristianP
Hi GamP,
i used the DFIX Method!!! Works great!!!
Thanks a lot to all!!!
Christian


WF Production Version: 7.7.02M
WF Test Version: 7.7.02M
Developer Studio: 7.7.02
HTML, EXL2K, FLEX, PDF,PPT