• copy csv files (2000)

    Author
    Topic
    #409331

    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

    Viewing 1 reply thread
    Author
    Replies
    • #871454

      Use the following :
      Name “c:datainput.csv” As “c:datastorefile-01012004-1640.csv “

      • #871779

        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”

        • #874016

          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?

          • #874020

            Use the FileCopy command.

          • #874021

            Use the FileCopy command.

          • #874048

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

            iNme = “C:DataInput.csv”
            oNme = “C:DataStoreFile” & “-” & Format(Date, “ddmmyyyy”) & “-” & Format(Time, “hhmm”) & “.csv”

            FileCopy iNme, oNme

            End Sub

          • #874049

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

            iNme = “C:DataInput.csv”
            oNme = “C:DataStoreFile” & “-” & Format(Date, “ddmmyyyy”) & “-” & Format(Time, “hhmm”) & “.csv”

            FileCopy iNme, oNme

            End Sub

        • #874017

          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?

      • #871780

        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”

    • #871455

      Use the following :
      Name “c:datainput.csv” As “c:datastorefile-01012004-1640.csv “

    Viewing 1 reply thread
    Reply To: copy csv files (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: