Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reverse naming of files

Status
Not open for further replies.

nycwipeout

IS-IT--Management
Apr 26, 2012
1
US
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
 
I don't understand the question. Can you post an example?

_________________
Bob Rashkin
 
Don't know about editing/changing PDF documents with Tcl. Probably not possible.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top