INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

reverse naming of files

reverse naming of files

(OP)
I need to build a workflow for right to left reading pubs and renumber the pages from say 238 to 000, 237 to 001 and so on. each pub will have a different page count.

I get 2 PDFs, one is a dummy file which has the page count in the filename "0512ESQ_Maps_238.pdf"

the 2nd PDF is the one that gets processed "ESQ050112_eReader.pdf" into single pages "ESQ050112_eReader_001.pdf"etc.

is there a tcl expression I can use?

I am currently using this to number one down #1_00[epr #3-1]
but want to know if I can reverse it in tcl

RE: reverse naming of files

I don't understand the question.  Can you post an example?

_________________
Bob Rashkin

RE: reverse naming of files

Don't know about editing/changing PDF documents with Tcl. Probably not possible.

RE: reverse naming of files

Or do you mean to something like this?

CODE

set i 238
while {$i > 0} {
  set k [expr 238 - $i]
  puts "$i --> $k"
  set i [expr $i - 1]
}
Output:

CODE

238 --> 0
237 --> 1
236 --> 2
235 --> 3
...
...
5 --> 233
4 --> 234
3 --> 235
2 --> 236
1 --> 237

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close