Jump to content


Photo

Regex for Folder?


  • Please log in to reply
21 replies to this topic

#1 zinni

zinni

    Advanced Member

  • UBot Users
  • PipPipPip
  • 72 posts
  • LocationGermany
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 30 June 2011 - 10:59 AM

Hi,

i will create a Upload Bot that Upload a File from Varibale Directory.

Example:

Step1

Bot Upload File from: D:\folder1\([A-Za-z0-9-]+)\folder2\file.zip

Step2

Bot return finish

Is this possible?

Best Regards
Z!nni

#2 UBotBuddy

UBotBuddy

    Professional Botter

  • Moderators
  • 3111 posts
  • LocationVirginia
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 30 June 2011 - 04:42 PM

I am going to move this to the Regex sub-forum as it is a better place for your question.

NewSig2.png


#3 zinni

zinni

    Advanced Member

  • UBot Users
  • PipPipPip
  • 72 posts
  • LocationGermany
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 01 July 2011 - 12:58 AM

Can i do this with "$Get files" Command in a list or how work the "$Get files" Command? I have in Script Reference nothing found.

Beste Regards
Z!nni

#4 LoWrIdErTJ - BotGuru

LoWrIdErTJ - BotGuru

    Botguru.net

  • Moderators
  • 3174 posts
  • LocationMichigan
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 01 July 2011 - 01:20 AM

get files will get the files in a specific folder.
used normally with a add to list or add to table for saving to csv, text file, or using a list in your bot.

Web Automation Bots @ BotGuru.net Want a Custom bot? click here or Email me
rjr.jpg

botgurusecured-banner.png

 


#5 zinni

zinni

    Advanced Member

  • UBot Users
  • PipPipPip
  • 72 posts
  • LocationGermany
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 03:45 AM

Does anyone have any idea, how I can implement the Regex in Folder?

Best Regards
Z!nni

#6 LoWrIdErTJ - BotGuru

LoWrIdErTJ - BotGuru

    Botguru.net

  • Moderators
  • 3174 posts
  • LocationMichigan
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 09:06 AM

Does anyone have any idea, how I can implement the Regex in Folder?

Best Regards
Z!nni



Give an example what your trying to accomplish?

Web Automation Bots @ BotGuru.net Want a Custom bot? click here or Email me
rjr.jpg

botgurusecured-banner.png

 


#7 zinni

zinni

    Advanced Member

  • UBot Users
  • PipPipPip
  • 72 posts
  • LocationGermany
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 09:16 AM

Here is a Example. The user will not need to specify the "unknown-directory".

Attached Files



#8 LoWrIdErTJ - BotGuru

LoWrIdErTJ - BotGuru

    Botguru.net

  • Moderators
  • 3174 posts
  • LocationMichigan
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 09:21 AM

you can check for the file to see if it exists. if it does proceed, else (do nothing or create it than proceed.)

TJ

Web Automation Bots @ BotGuru.net Want a Custom bot? click here or Email me
rjr.jpg

botgurusecured-banner.png

 


#9 JohnB

JohnB

    Advanced Member

  • UBot Users
  • PipPipPip
  • 3350 posts
  • LocationNJ
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 09:31 AM

So Folder 1 and subfolder are known directories and the one between them is always going to be unknown? Logically, I can't really wrap my head around that, but in any event, the only way I was able to attempt that was unsuccessful. The $get files constant does not include subdirectories so there is no original text from which you can draw a $find regular expression.

John

#10 zinni

zinni

    Advanced Member

  • UBot Users
  • PipPipPip
  • 72 posts
  • LocationGermany
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 09:41 AM

So Folder 1 and subfolder are known directories and the one between them is always going to be unknown? Logically, I can't really wrap my head around that, but in any event, the only way I was able to attempt that was unsuccessful. The $get files constant does not include subdirectories so there is no original text from which you can draw a $find regular expression.

John


I have create a Software, thats have a generated Folder. Thats the Unknown Folder. I have the Idea to create a *.bat file with this:
dir /b folder.txt

But Ubot Studio can`t run this :-( click i the *.bat manually than works fine.

#11 LoWrIdErTJ - BotGuru

LoWrIdErTJ - BotGuru

    Botguru.net

  • Moderators
  • 3174 posts
  • LocationMichigan
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 09:46 AM

why have a bat, or anything other then ubot create the folder?

if your targeting the desktop, or programs tree you should be able to create a folder anywhere you like.

TJ

Web Automation Bots @ BotGuru.net Want a Custom bot? click here or Email me
rjr.jpg

botgurusecured-banner.png

 


#12 zinni

zinni

    Advanced Member

  • UBot Users
  • PipPipPip
  • 72 posts
  • LocationGermany
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 09:51 AM

My Program have a file (file1.csv) in Unknown folder. I need this File. I will not create a folder or anything else. I need only the file1.csv thats my program have generated.

#13 LoWrIdErTJ - BotGuru

LoWrIdErTJ - BotGuru

    Botguru.net

  • Moderators
  • 3174 posts
  • LocationMichigan
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 10:11 AM

My Program have a file (file1.csv) in Unknown folder. I need this File. I will not create a folder or anything else. I need only the file1.csv thats my program have generated.



So have ubot create the file in a location that the bot can read from.
ie: desktop, app folder, document folder
and read from it.

Delete when done if you like or it can remain there as the next time it is ran it will overwrite itself.

TJ

Web Automation Bots @ BotGuru.net Want a Custom bot? click here or Email me
rjr.jpg

botgurusecured-banner.png

 


#14 zinni

zinni

    Advanced Member

  • UBot Users
  • PipPipPip
  • 72 posts
  • LocationGermany
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 10:30 AM

I have do this but it dosn`t work with Ubot Studio.

Example:

Create a directory on Desktop with name: "folder1".

Than create another directory with name: "folder2"

run the .ubot file in my attachment and see it dosn`t work :-(

Attached Files



#15 LoWrIdErTJ - BotGuru

LoWrIdErTJ - BotGuru

    Botguru.net

  • Moderators
  • 3174 posts
  • LocationMichigan
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 10:34 AM

Try the attached.

no need for shell
no need for any the other ways you were trying..

Attached Files


Web Automation Bots @ BotGuru.net Want a Custom bot? click here or Email me
rjr.jpg

botgurusecured-banner.png

 


#16 zinni

zinni

    Advanced Member

  • UBot Users
  • PipPipPip
  • 72 posts
  • LocationGermany
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 10:46 AM

It's not the same. I need a Ubot that uploading a file from a directory, which I do not know.

I need a file from this Directory: %desktop%\folder1\any-name-of-directory\file.csv

The any-name-of-directory is a Directory, wich name i not known.

Best Regards
Z!nni

#17 LoWrIdErTJ - BotGuru

LoWrIdErTJ - BotGuru

    Botguru.net

  • Moderators
  • 3174 posts
  • LocationMichigan
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 11:11 AM

why does it have to be any name of a directory in that position?

there could be multiple folders all with a csv in them. therefore it would continuously loop because it wouldn't know which one to choose, and or would only choose the first one it came across.

To grab specific data is best to create the folder so that it is pin pointed exactly for the csv your needing.


If it is a specific csv that is needed to be grabbed, then have it setup as a User Input (UI open file) command.
thus giving the precise csv that is to be used.


TJ

Web Automation Bots @ BotGuru.net Want a Custom bot? click here or Email me
rjr.jpg

botgurusecured-banner.png

 


#18 zinni

zinni

    Advanced Member

  • UBot Users
  • PipPipPip
  • 72 posts
  • LocationGermany
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 11:24 AM

why does it have to be any name of a directory in that position?

I have create a Software, thats generate a User Directory. (example "1hfgfGGHbdUSER") In this Directory is a Stat file. (file1.csv)

The user should not even write the path in a ui panel or file. It should be read automatically. I wanted to ask if this is possible?

#19 LoWrIdErTJ - BotGuru

LoWrIdErTJ - BotGuru

    Botguru.net

  • Moderators
  • 3174 posts
  • LocationMichigan
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 11:54 AM

so in your bot. the stat file that is generated you also set the folder it is saved in. therefore you can use a set command to set the variable of the folder name it is saved to. and call it at a later time to bring up the csv file.

Web Automation Bots @ BotGuru.net Want a Custom bot? click here or Email me
rjr.jpg

botgurusecured-banner.png

 


#20 JohnB

JohnB

    Advanced Member

  • UBot Users
  • PipPipPip
  • 3350 posts
  • LocationNJ
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 02 July 2011 - 12:27 PM

Not to mention UBot can create a random folder name in the same manner. You don't need an external app for that.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users