rejetto forum

Multiple file rename

0 Members and 1 Guest are viewing this topic.

Offline s4isw4l4qu4tro

  • Occasional poster
  • *
    • Posts: 16
    • View Profile
Hello HFS coders,

I have a folder where users can upload files that contains a bunch of pdf files, i need to rename this files from

(before)                 
5311_428A_rev-0.pdf
3456_a142_rev-C.pdf
3471_p465_rev-A.pdf
3110_10A_rev-F.pdf
3511_m17_rev-1.pdf

(after)                   
428A.pdf
a142.pdf
p465.pdf
10A.pdf
m17.pdf

then move the renamed file to a specified folder & delete the contents in the upload folder

Can this be achieve with diff template?

Help much apprciated


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
something as

[upload name]
{.if{.%item-ext% = pdf.}
  |{:{substring|_|_|%item-name%|include=none.}.%item-ext%.}:}
  |{:%item-name%:}
/if}

[upload completed]
{.move| ......            read the wiki to more help
{.delete|.....
with this, only the uploaded file as first_new_last.pdf is renamed to  new.pdf , others are not changed.
« Last Edit: February 09, 2010, 11:36:00 AM by Mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
the scripts mars posted must be put in the EVENTS, not diff template.
ALT+F6


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
Quote
ALT+F6

events are only avalable with build beta  ;)