Focal Point
[SOLVED] CSV master file

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

March 06, 2009, 02:16 PM
MacLonghorn
[SOLVED] CSV master file
I've got a pre-existing CSV file on the drive and want to access it in WF. I tried to create synonym via every tool in the WF playbook, typically by right-clicking the Delimited Flat File adapter, add synonym and it just doesn't work. I put in the directory location, filename, extension. Nothing works. (imagine that!)
So I had to create it manually in DM. Good, so I got it working on my laptop, but when I did the same thing on the WF server I get an empty record set (no error).

The master file I created has SUFFIX=DFIX, but I don't think that's the best way. I think COMT is the way to do this, but I can't find the exact syntax description, other than:
FILENAME=filename, SUFFIX=COMT,
SEGMENT=segment, SEGTYPE=segtype,

And of course, none of the WF interface tools are letting me do it either, so the questions are:
1. Is this the right syntax? If so, are there any "$" at end of lines?
2. What goes in "filename"? the full path?

I've tried the following with an error:
FILE="C:\Documents and Settings\myname\My Documents\directory1\myfile.csv" ,SUFFIX=COMT ,$
SEGNAME=FLT_IMPORT ,SEGTYPE=S0,$

It's very frustrating b/c the tools don't work, and there's little documentation on how to do this manually (again, it figures)
I'm on WF 764/Win.

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


Thanks.

Mark
WF 7.6 Windows
March 06, 2009, 02:32 PM
GinnyJakes
I just recently uploaded a csv file to a Unix box and created a DFIX master and access file and it worked just fine.

Another thing you can do since you have 7.6 is to do an import of your csv file into your WebFOCUS architecture. You do this in Dev Studio. If you are using the virtual directories, you would right click Master File and then select New and then Upload Data File. I have done that a number of times even to Unix and it works just fine. You have to tweak the field formats a little.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
March 06, 2009, 02:36 PM
FrankDutch
Mark

What is your CSV file look like.
If it is real CSV then I would expect commas between the fields.
Did you try COM? or FIX?
COMT means tab delimited.

The filename might be C:\... but that is the C:\ drive on the server and not on your pc.
If you put the text file in the baseapp and the master also I think the location is not needed since that is the default.

Post the first line of your text file and your master, we might help better.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

March 09, 2009, 05:08 AM
GamP
mark,

I thought it was something like:
FILENAME=MYCOMT, SUFFIX=COMT, DATASET="C:\Documents and Settings\myname\My Documents\directory1\myfile.csv" ,$
SEGNAME=FLT_IMPORT ,SEGTYPE=S0,$


Using COMT means that you have a comma-separated file with the column titles in the first row. Is that the case? If there are no column titles, use SUFFIX=COM.

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
March 09, 2009, 03:17 PM
MacLonghorn
I read somewhere in WF docs that COMT = comma delimited with column headings.


Thanks.

Mark
WF 7.6 Windows
March 09, 2009, 03:22 PM
MacLonghorn
I'll try an import in 7.6, see if that helps.

Dutch, yes, I'm trying to refer to the server's hard drive. Here's the first line of the CSV
API,MeasureDate,MeasureTime,PumpSettingDepth,JointsToSeatingNipple,JointsToFluid
4223700088,2/20/2009,12:16 PM,2210,75,71


Here's the master:
FILENAME=MYCOMT, SUFFIX=COMT, DATASET="c:\ibi\apps\heputils\flt_imp.csv" ,$
SEGNAME=FLT_IMPORT ,SEGTYPE=S0,$
    FIELDNAME=API, ALIAS=API, USAGE=A10, ACTUAL=A10, $
    FIELDNAME=MEASUREDATE, ALIAS=MeasureDate, USAGE=MDYY, ACTUAL=A9, $
    FIELDNAME=MEASURETIME, ALIAS=MeasureTime, USAGE=A8, ACTUAL=A8B, $
    FIELDNAME=PUMPSETTINGDEPTH, ALIAS=PumpSettingDepth, USAGE=I6, ACTUAL=A6, $
    FIELDNAME=JOINTSTOSEATINGNIPPLE, ALIAS=JointsToSeatingNipple, USAGE=I3, ACTUAL=A3, $
    FIELDNAME=JOINTSTOFLUID, ALIAS=JointsToFluid, USAGE=I3, ACTUAL=A3, $
    DEFINE MDATEA/A8MDYY  WITH API=MEASUREDATE; $
    DEFINE MTIMEA/A8  WITH API=LOCASE(8,MEASURETIME,'A8'); $
    DEFINE MDT/A20  WITH API=EDIT(MDATEA,'99/99/9999') | ' ' | MTIMEA; $



Thanks.

Mark
WF 7.6 Windows
March 09, 2009, 03:24 PM
susannah
at the risk of buying you a vowel when you don't need one,
you've got SET PCOMMA = ON
yes?

yes comt means ignore the 1st row, but make sure that the names in that first row don't blow you out of your column width specs in the master..i've had that pain.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
March 09, 2009, 03:52 PM
MacLonghorn
ok, got it working. thank you all.

Ginny, I got the CSV master file created by doing the import as you suggested. I changed the type to COMT and put my real CSV file in the dir.


Thanks.

Mark
WF 7.6 Windows
March 09, 2009, 03:54 PM
GinnyJakes
Excellent! I'm happy it worked for you.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google