Differentiating between "A1", "A12", "A13"
Differentiating between "A1", "A12", "A13"
- Subject: Differentiating between "A1", "A12", "A13"
- From: "Wadson, David" <email@hidden>
- Date: Wed, 9 Jan 2002 15:50:39 -0500
A list of files named:
A1...plus some other characters
A10...plus some other characters
A11...plus some other characters
A12...plus some other characters
A2...plus some other characters
A3...plus some other characters
A4...plus some other characters
A5...plus some other characters
A6...plus some other characters
A7...plus some other characters
A8...plus some other characters
A9...plus some other characters
Two problems - there will be other files in the list named started with B1,
B2,... C1, C2,...etc. I also won't know how many files will start with "A" -
there could be 8, 10, or 12 files.
I need to process each file in numerical order. By using a simple loop
incrementing from 1 to however many files I have, I've been selecting the
appropriate files by looking for the the files that "starts with A2", or
"starts with A3". But if I'm searching for the page that starts with "A1", I
also get pages "A10", "A11" and "A12". I could also use an identifying
character after the number to eliminate this problem - i.e. select the files
that start with "A1-", "A2-","A11-" and that would select the right file.
However, I'm trying to really idiot proof this script and make it not
necessary to consider have a specific character after the number. That way
it won't matter if the user has accidentally named a file incorrectly.
I've been mucking around trying to figure out how to isolate A1 from the
other sequences that start with it but haven't had much luck creating a
reliable routine to do it. Perhaps I'm trying to invent a wheel that already
exists. Does anyone have any ideas on how to easily accomplish this task?
In case anyone is wondering, I'm trying to process of bunch of sequential
newspaper pages contained in individual PDF files and merge them into a
single document, with the pages in proper order. The number of pages and
sectiosn will vary depending upon the day. I have the program done but want
to make it less stringent on the filenames being 100% correct...
Thanks in advance..