I am getting a .csv file which is TAB delimited. Can someone please guide me how to create a master file for that? Can this be done?? How can a master file be created for a tab delimited .txt file. I tried SUFFIX=COM, but that is not working.This message has been edited. Last edited by: Kerry,
WF: 7.6.8 OS/Platform: Windows, Unix
July 01, 2010, 04:37 PM
jfr99
Hi,
Look at this and see if this helps. This is using SUFFIX=DFIX and the DELIMITER is a TAB. You should be able to cut and paste this and run it.
Jim
-* -** CREATE FILE - TAB_FILE -* FILEDEF DATA DISK tab_file.txt -RUN -WRITE DATA Doe Jane 111-222-3333 -WRITE DATA Simpson Bart 444-555-6666 -WRITE DATA Simpson Homer 777-888-9999 -CLOSE -RUN -* FILEDEF MASTER DISK tab_file.mas -RUN -WRITE MASTER FILENAME=TAB_FILE, SUFFIX=DFIX,$ -WRITE MASTER SEGMENT=TAB_FILE, SEGTYPE=S0,$ -WRITE MASTER FIELDNAME=LAST_NAME,,A30,A30,$ -WRITE MASTER FIELDNAME=FIRST_NAME,,A30,A30,$ -WRITE MASTER FIELDNAME=TEL_NO,,A12,A12,$ -WRITE MASTER FIELDNAME=DELIMITER, ALIAS=' ',A01,A01,$ -CLOSE -RUN -* FILEDEF tab_file DISK tab_file.txt -RUN -* -** CREATE REPORT - TAB_FILE -* TABLE FILE TAB_FILE PRINT LAST_NAME FIRST_NAME TEL_NO END
WebFocus 8.201M, Windows, App Studio
July 01, 2010, 05:28 PM
Neenz
Thanks!
But that does not work when there is a comma in the name. Say if my first name is SAM,PETER then it is not working out fine.
WF: 7.6.8 OS/Platform: Windows, Unix
July 01, 2010, 05:38 PM
jfr99
It seems to work for me. When I use the following data
-WRITE DATA Simpson SAM,PETER 444-555-6666
Then the first name prints like "SAM,PETER".
Jim
WebFocus 8.201M, Windows, App Studio
July 01, 2010, 05:39 PM
Neenz
sorry it is SAM ,PETER.
WF: 7.6.8 OS/Platform: Windows, Unix
July 02, 2010, 02:30 AM
<JG>
suffix for tab delimited files are
SUFFIX=TAB or SUFFIX=TABT if the file contains a header row
July 02, 2010, 02:34 PM
Neenz
Tried that too. Does not work.
I think the spaces in between in each fields are screwing up. Say I have a a field name and there are spaces b/n first name and last name.
WF: 7.6.8 OS/Platform: Windows, Unix
July 03, 2010, 06:30 AM
<JG>
It works fine providing you do not have any embeded tabs in the data, exactly the same way that com does providing that you do not have any embeded commas.
Have you looked at the file using a tool that can display tabs, MS word would do. I suspect that the file is not valid from a logical delimiter point of view.
July 04, 2010, 06:21 AM
FrankDutch
Neenz
why is your csv file tab delimited....
If ppl send me that kind of files and it is meant for futher use, I would go to the creator and ask for a format that is more easy and more relayable to handle. CSV should be what it says to be....comma separated .
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