Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I'm doing some work scanning a large amount of files into a computer system. I'm stuck with the software that's been dumped on me for the time being, so I'm looking for a quick way to organize and name what I've got. Here's the current situation:
The scanning software propts for a job name, which is then used as a directory name. Each page is saved as an individual tiff file, 0000001.tif to xxxxxxx.tif, depending on the number of pages. So, each document sits in its own directory. The directory name is important, since it identifies what the document is. I'm scanning in Windows, but I've moved the files to my linux box.
Can I use a script to automatically combine all the tiffs in a given directory (using tiffcp, perhaps) and convert to pdf (tiff2pdf?).
How can I make that script, and how can I make it run recursively, so I don't have to manually enter each directory?
Is it possible, once that's done, to run another script where each of the newly created PDFs are given the same name as the directory they sit in? The way things are set up, each directory should only contain a single PDF, so there won't be repeating filenames within a directory.
And while I'm at it, the scanning software is tossing in extra files I don't want. Is there a way to delete all files with a given extension within all subdirectories? Again, there's a lot of manipulation going on, all of it pretty basic, but it's spread out in so many sub directories that doing it by hand would take forever.
Thanks in advance for any help.
ETA: Just after I posted, I figured out how to delete the files in subdirectories, so all those .dat files are gone. Ignore the last question.
Thanks for the help so far. That made things much easier for me. As for the tiff stuff, I wrote a basic script, and I'm just running it on each directory. It's time consuming, but it's got to get done.
for dir in $(ls); do # do the following on all files/dirs
if [ -d $dir ]; then # only if it is a directory
#do something with the files here...
# perhaps remove the files
# perhaps rmdir $dir