Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Rearranging a date in $Name using an agent (Read 2347 times)
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Rearranging a date in $Name using an agent
Oct 19th, 2012, 12:06pm
 
Building on this thread, what if you have titles starting DD/MM/YYYY and wanted then to start YYYY/MM/DD for easier sorting on $Name?

So,
"26/10/2012 Desperately tried to work out what to do"
becomes
"2012/10/26 Desperately tried to work out what to do"

An agent to the rescue! Try this.

Query:  $Name.contains("^(\d{2})/(\d{2})/(\d{4})(.*)")
Action:  $Name = $3+"/"+$2+"/"+$1+$4

Again, no note level rules involved. The agent is self emptying too, as once changed, the $Name no longer meets the query.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1
Send Topic Print