Navigation

    OpenIAP

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Get filenames in folder

    General Discussion
    filewatchrdtctr openrpa
    2
    3
    37
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Flávio Pinheiro de Souza
      Flávio Pinheiro de Souza last edited by

      I use the two FileDetector methods (via node-red and DoWhile) both work very well. However I want to get the names of the files inside a folder. Can you give me the path of the stones (how to do it?);)

      Allan Zimmermann 1 Reply Last reply Reply Quote 0
      • Allan Zimmermann
        Allan Zimmermann @Flávio Pinheiro de Souza last edited by Allan Zimmermann

        I'm not sure if your asking how to get the the path of the item that trigger the detector, or asking in general how to get the names of all files in a folder ?
        If the first, use

        System.IO.Path.GetDirectoryName("c:\temp\findme.txt")
        

        If you want to get all files inside a folder, use

        System.IO.Directory.GetFiles("c:\temp")
        

        ( Use For Each With Body Factory with type set to string to loop it )
        That will return an array of full path and filename, so if you then only want the file name, use

        System.IO.Path.GetFileName(item)
        
        Flávio Pinheiro de Souza 1 Reply Last reply Reply Quote 0
        • Flávio Pinheiro de Souza
          Flávio Pinheiro de Souza @Allan Zimmermann last edited by

          @allan-zimmermann
          Yes, it was the second option, but all the other options served me.
          Thanks again.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post