Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: Batch importing CVS files

  1. #1
    Guest

    Default

    Hi,
    I am looking to import lots of cvs files with different names, eg
    0503200201.htd,
    0503200202.htd,
    0503200203.htd
    and so no. After importing I want to delete this files. Is the possible in Excel OR Access.

    Thanks

    Bscull.

  2. #2
    Guest

    Default

    Sorry,

    CSV FILES

    bscull

  3. #3
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    In the VBE editor look up "Kill"

    eg. Kill "c:CSVFiles*.csv"

    will delete ALL files with csv extensions.
    Pay to put in an error routine + confimation
    JIC !!

    Sub kills()
    Dim OKToDelete As Integer
    Dim sDir As String

    sDir = "C:CSVFiles"

    On Error GoTo FileErr
    OKToDelete = MsgBox("Delete files in " & sDir, vbYesNo)
    If OKToDelete = vbNo Then End
    Kill sDir & "*.csv"
    MsgBox "Done!"

    FileErr:
    MsgBox Err.Number & ":=" & Err.Description

    End Sub


    or something similar


    HTH

    Ivan

  4. #4
    Guest

    Default

    Great, Thanks.

    But how can I batch import lots of files with different names? There is only some parts of the file structure that I need to use.

    Thanks

    Bscull

  5. #5
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-06 03:05, Anonymous wrote:
    Great, Thanks.

    But how can I batch import lots of files with different names? There is only some parts of the file structure that I need to use.

    Thanks

    Bscull
    Have a look at:

    http://ca.geocities.com/b_davidso/We...excel_vba.html

    and look for the question "I have an Excel Template file (report.xlt) and text files (1.txt, 2.txt, 3.txt etc - 45 of this text files) in the same directory". The code for this could easily be modified to do what you're looking for. If you need any help just let me know.

    Regards,

    Barrie Davidson

    "You're only given a little spark of madness. You mustn't lose it." - Robin Williams

  6. #6
    Guest

    Default

    THANKS Everyonbe.

    Barrie if i need a hand I will give you a call

    Thanks again.

    Bscull

  7. #7
    Guest

    Default

    THANKS Everyone.

    Barrie if i need a hand I will give you a call

    Thanks again.

    Bscull

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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