Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    copy csv files (2000)

    I have a csv file called c:datainput.csv, which I process into a table then delete. Before the processing, how can i copy it to another file using a name which includes the date and time eg. c:datastorefile-01012004-1640.csv

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy csv files (2000)

    Use the following :
    Name "c:datainput.csv" As "c:datastorefile-01012004-1640.csv "
    Francois

  3. #3
    New Lounger
    Join Date
    Sep 2004
    Location
    Roodepoort, South Africa
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy csv files (2000)

    Or even better if you don't want to put in the date and time every time:

    Name "c:datainput.csv" As "c:datastorefile-" & Format(Date, "ddmmyyyy") & "-" & Format(Time, "hhmm") & ".csv"

  4. #4
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy csv files (2000)

    Thanks for the replies - only just got round to checking them out.
    The Name File1 As File2 works fine - but I need to make a COPY, not simply rename the file - any other thoughts?

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: copy csv files (2000)

    Use the FileCopy command.

  6. #6
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy csv files (2000)

    Private Sub Command1_Click()
    Dim iNme As String
    Dim oNme As String


    iNme = "CataInput.csv"
    oNme = "CataStoreFile" & "-" & Format(Date, "ddmmyyyy") & "-" & Format(Time, "hhmm") & ".csv"

    FileCopy iNme, oNme

    End Sub

  7. #7
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy csv files (2000)

    many thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •