Importing delimited text in script 
Author Message
 Importing delimited text in script


Quote:
>I'm trying to import ascii into a table from a , delimited file. This
>must be done in a PDOWIN objectpal script. the scenerio is as follows:
>the file calls.log is created when a call comes into the trunk. it is ,
>delimited in the form of START_TIME, TRUNK, STOP_TIME. When i start my
>database, I would like for this piece of code to append this information
>to the end of an existing table, verify that it was imported without
>error then delete the calls.log file. So far the only thing I can find
>info on is the deleting portion. I read about calling paradox dialog
>boxes, but the book says that this would require intervention.
>Thank you in advance for your time on this matter.

Here you go....

method run(var eventInfo Event)
var
  fs  FileSystem   ; Used to find and delete calls.log file
  tbl Table        ; Used to add records to destination table
endvar

; Check if the file exist, exit if not
if not isFile("calls.log") then
  msgStop("ERROR","Could find \"calls.log\".")
  return
else

  ; Import the calls.log file to a temp table in the private directory.
  ; Fields are seperated by a comma and delimited by nothing.  
  importASCIIVar("calls.log", ":PRIV:tempcall.db", ",", "", False, False)

  tbl.attach(":PRIV:tempcall.db") ; Open a Table varible on the source table

  tbl.add("CALLS.DB",True,False)  ; Append the records to the CALLS table

  tbl.delete()                    ; Delete the tempy table

  fs.delete("calls.log")          ; Delete the import file

  msgInfo("Import Done","")

endif

endmethod

-joe
--

||   || ||\/|| ||=||   |||     Phone : (408) 425-7455
!!!! !! !!  !! !! !! !!   !!   Fax   : (408) 425-7516



Fri, 22 Nov 1996 15:42:08 GMT
 Importing delimited text in script

I'm trying to import ascii into a table from a , delimited file. This
must be done in a PDOWIN objectpal script. the scenerio is as follows:
the file calls.log is created when a call comes into the trunk. it is ,
delimited in the form of START_TIME, TRUNK, STOP_TIME. When i start my
database, I would like for this piece of code to append this information
to the end of an existing table, verify that it was imported without
error then delete the calls.log file. So far the only thing I can find
info on is the deleting portion. I read about calling paradox dialog
boxes, but the book says that this would require intervention.
Thank you in advance for your time on this matter.


Fri, 22 Nov 1996 11:20:33 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Importing TAB Delimited Text Script

2. Importing Delimited Text File

3. need more ideas on importing delimited text files

4. need ideas on importing delimited text files

5. import delimited text file w/o bulk insert or DTS

6. importing a ascii text, pipe delimited file

7. Importing Delimited text file to Sql 7.0

8. Importing delimited text file into SQL Server Database

9. Importing Tab delimited Text File

10. Importing Tab Delimited Text File

11. importing comma delimited text file into SQL Server 6.0 table

12. importing text delimited files


 
Powered by phpBB® Forum Software