Hello and welcome to our community! Is this your first visit?
Register
Results 1 to 3 of 3
  1. #1
    TDF Member
    Join Date
    Sep 2013
    Location
    LA, Phoenix, Nogales, Cambridge, Mosta
    Posts
    266
    Likes (Given)
    29
    Likes (Received)
    153

    VIsual Basic . Net question

    I am looking for a little help on VB.net something I have little experience with.

    I have a system that has a limited embed VB.net library (i.e. not all the instructions I find on the www are in the unit).

    I have a file copy routine that works well. As long as I know the original file name. However, I have a file that the unit creates with an ever changing file name, which i want to copy. I can find the directory easy enough (even though this is changed - based on the current date) but have been unable to recover the unique file name. It is a csv file. I tried "*.csv" but it doesn't appear to treat * as wildcards (like I'm used to from DOS.)

    Any ideas for a simple routine. To either copy all files with *.csv, all files in the directory.
    I haven't been able to just copy the directory, I think because I am moving it from the HMI area to the FTP area and it is treating it as if it is moving from one drive to another, which I understand is a limitation of move directory or copy directory command.

    cheers

  2. #2
    Established TDF Member
    Join Date
    Jan 2013
    Location
    South of France
    Posts
    504
    Likes (Given)
    115
    Likes (Received)
    131
    Does Directory.EnumerateFiles not do what you need?

  3. #3
    Established TDF Member
    Join Date
    May 2014
    Location
    Colchester
    Posts
    1,313
    Likes (Given)
    1727
    Likes (Received)
    326
    According to stackoverflow, wildcards are only supported in like expressions so your match expression presumably would be:

    like "*[.]" & "csv"

    https://stackoverflow.com/questions/...-with-wildcard


 

Posting Permissions

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