View previous topic :: View next topic |
Author |
Message |
rgarrison
Joined: 06 May 2010 Posts: 2
|
Posted: Thu May 06, 2010 8:54 am Post subject: Regex confusion |
|
|
I am new to this and not the best at expressions. I am trying to setup a task that will move all files that start with
abc and ends with .txt
so the files are like abc_all-different-names.txt
But some of them have .cvs or .doc and I do not want then so selecting just .txt or just abc* will not work I need both rules only the files that start with abc and only the files that have the extension of .txt
Is this possible? |
|
Back to top |
|
 |
melvin Site Admin
Joined: 25 May 2006 Posts: 635 Location: Santa Barbara, california
|
Posted: Thu May 06, 2010 10:18 am Post subject: |
|
|
For the filename field use:
REGEXF=abc[.]{1,}txt
[.] matches any character
{1,} matches 1 or more of preceeding..
so [.]{1,} matches one or more of any character |
|
Back to top |
|
 |
rgarrison
Joined: 06 May 2010 Posts: 2
|
Posted: Thu May 06, 2010 10:53 am Post subject: |
|
|
Thank you for responding but the files did not move and it says the following:
Total number of files in folders meeting folder name criteria = 311
May 6, 2010 1:48:14 PM
Total number of files meeting filename criteria = 0
May 6, 2010 1:48:14 PM
Total number of files meeting filename criteria and date modified criteria = 0
May 6, 2010 1:48:14 PM
Total number of files meeting filename criteria, date modified criteria, and new modified files criteria = 0
But here is a real name of a file there: abc_performance_analytics_patient_details_ch.txt |
|
Back to top |
|
 |
bamos
Joined: 28 May 2010 Posts: 3
|
Posted: Fri May 28, 2010 6:20 am Post subject: |
|
|
I'm also new at these types of expressions and I'm trying to do something similar. I'm coming at it from a Windows admin angle. I need to transfer any pdf files that start with 88. For example:
883765897.pdf
I was working to transfer existing jobs from another app that we used into Automize and basically copied the old settings over. The old app was Windows only and used 88*.pdf. That seemed to work properly in Automize until we found that it was transferring any file that had 88 in the filename anywhere. So, if I ran it that way, 883765897.pdf and 478899345.pdf would both be transferred.
I tried the 88[.]{1,}pdf format as shown above, and got the same results as the original requestor... nothing transferred. I then tried it as 88.{1,}pdf , but both transferred.
Any way to specify that 88 must be at the beginning of the file name? |
|
Back to top |
|
 |
melvin Site Admin
Joined: 25 May 2006 Posts: 635 Location: Santa Barbara, california
|
Posted: Wed Jun 02, 2010 8:42 am Post subject: |
|
|
\A88 should match start of string.
if java regex does not support it then try:
^88 |
|
Back to top |
|
 |
|