Jump to content
UBot Underground

Scrape Dokument-Names From A Folder


Recommended Posts

Hi @all, 

 

i have a folder with some .pdf documents like 19-0215458-test.pdf or 20-0357896.pdf

 

Now i want to scrape the first 10 digits from each document name.  :unsure:

 

Can someone help me please ?  :)

Link to post
Share on other sites

Here is a function with an example:

 

clear list(%files)
add list to list(%files,$list from text("19-0215458-test.pdf
20-0357896.pdf
20-035789620-035789620-035789620-0357896.pdf",$new line),"Delete","Global")
loop($list total(%files)) {
    set(#file,$next list item(%files),"Global")
    alert($GetFirstTenDigits(#file))
}
define $GetFirstTenDigits(#_text) {
    comment("Get all digits")
    set(#_digits,$replace regular expression(#_text,"[^0-9]+",$nothing),"Local")
    if($comparison($text length(#_digits),"< Less than",11)) {
        then {
            comment("If less than 11 then return")
            return(#_digits)
        }
        else {
            comment("Else return first 10 only")
            return($substring(#_digits,0,10))
        }
    }
}

  • Like 1
Link to post
Share on other sites

only here i can´t find a solution: 

 

"$list from text" is no problem, but never before scraped dokument names from a folder. 

 

navigate("D:\\Dokumente\\Desktop\\list","Wait")

add list to list(%file,$scrape attribute(<??>,"??"),"Delete","Global")

 

:unsure:

post-1532-0-05539800-1584701469_thumb.jpg

post-1532-0-83019800-1584701846_thumb.jpg

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...