I'm trying to read a Text file (CSV format) which is kept in my domain. I used below code to read the text file but it throwing below error. Note - I havent created any MDF for employee.txt file.
APP PATH EMPLYCONNECT FILEDEF EMPL DISK EMPLOY/employee.txt TABLE FILE EMPL PRINT * END
Error message with i run the procdure (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: EMPL BYPASSING TO END OF COMMAND
Question - Can i read text/excel file without creating master file?This message has been edited. Last edited by: Kerry,
WF 7702m / Windows
May 23, 2012, 03:57 AM
Kittuputtu
a small correction in the code APP PATH EMPLYCONNECT FILEDEF EMPL DISK EMPLYCONNECT/employee.txt TABLE FILE EMPL PRINT * END
WF 7702m / Windows
May 23, 2012, 11:09 AM
GamP
Well, if you have created a mastger file for the data you won't be able to read it with TABLE. And that's what the error message tells you: it can't find the mdf called EMPL.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
May 23, 2012, 12:56 PM
John_Edwards
For a CSV file you can create a plain-jane master file -- one big text field per line. That should read, but then it will be up to you to parse the contents of that single field into its independent parts.
Note that in Dev Studio you can auto-generate a master file from a flat file by right-clicking in the Master Files section of an application directory and selecting New-->Upload Data File. That will parse the file for you for a first round.
If you need to absorb a differently-shaped file each time you'll have to go with the plain-jane option above. If your files will contain the same structure each time and you want to create a master file from your first one option 2 above will help you get started.
J.
May 23, 2012, 05:35 PM
Waz
Internally WebFOCUS needs a master file when you issue a TABLE FILE command.
When you issue TABLE FILE EMPL, WebFOCUS looks for the EMPL master file so it can find ouy what type of file it is. This is done by checking the suffix in the master. Then the appropriate module is loaded to read the data.
All the fields are needed as well, so WebFOCUS knows the field names and formats.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
May 24, 2012, 01:55 AM
Kittuputtu
Thanks for all the answers...that helped!! If i create Master file for text/Excel, then i need to use FILEDEF command to read Text/excel file. I wanted to know if is it possible to read text or other flat file without creating master file using FILEDEF command?
WF 7702m / Windows
May 24, 2012, 02:06 AM
Waz
What do you want to do with the data ?
You can use -READ to read the file, on line at a time, but that is into dialog manager variables.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
May 25, 2012, 10:03 AM
ABT
quote:
Originally posted by John_Edwards: For a CSV file you can create a plain-jane master file -- one big text field per line. That should read, but then it will be up to you to parse the contents of that single field into its independent parts.
Note that in Dev Studio you can auto-generate a master file from a flat file by right-clicking in the Master Files section of an application directory and selecting New-->Upload Data File. That will parse the file for you for a first round.
If you need to absorb a differently-shaped file each time you'll have to go with the plain-jane option above. If your files will contain the same structure each time and you want to create a master file from your first one option 2 above will help you get started.
J.
Have to disagree with this. I have a .csv file and a master that breaks it up into "fields" for reporting.