04-25-2012
Script for creating a directory & move the .tif files in it.
Hi Team,
I have thousands of TIF files which are converted from PDF. Below is a sample of it.
LH9406_BLANCARAMOS_2012041812103210320001.tif
LH9406_BLANCARAMOS_2012041812103210320002.tif
LH9406_BLANCARAMOS_2012041812103210320003.tif
LH9411_ANGENIAHUTCHINSON_2012041812102510250001.tif
LH9411_ANGENIAHUTCHINSON_2012041812102510250002.tif
LH9411_ANGENIAHUTCHINSON_2012041812102510250003.tif
LH9411_ANGENIAHUTCHINSON_2012041812102510250004.tif
LH9411_ANGENIAHUTCHINSON_2012041812102510250005.tif
LH9412_DANIELMATEO_2012041812102310230001.tif
LH9412_DANIELMATEO_2012041812102310230002.tif
LH9414_MICHAELLEWIS_2012041812102010200001.tif
LH9414_MICHAELLEWIS_2012041812102010200002.tif
LH9414_MICHAELLEWIS_2012041812102010200003.tif
LH9414_MICHAELLEWIS_2012041812102010200004.tif
I want to create folders like LHR-001,LHR002,LHR-003.....& w ant to move approximately 50 to 60 images in one folder in such a way that all images of first part of file name should be in one folder.
eg. If first 50 files moves in LHR-001 folder & 50th file is
LH9411_ANGENIAHUTCHINSON_2012041812102510250003.tif then it should move the remaining 2 files (LH9411_...004.tif & LH9411_...005.tif) also in LHR-001. Means count of that folder is 52 & afterwards it goes further to move files in LHR-002.
I have a script which create a folder & moves 50 files in it but that script moves exact 50 files. The problem is, if i run that script the sometimes images from single PDF are split in two folders. Here is my script sample....
cc=50; c=0; folder=1; for i in *; do c=`expr $c + 1`; let "r = $c % $cc" ; if [ $r -eq 0 ] ; then folder=`expr $folder + 1` ; fi ; if [ ! -d $folder ]; then mkdir $folder; fi ; mv "$i" $folder/ ;done
Please help me out.
Thank You.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Is this possible? Let me know If I need specify further on what I am trying to do- I just want to spare you the boring details of my personal file management.
Thanks in advance-
Brian- (2 Replies)
Discussion started by: briandanielz
2 Replies
2. UNIX for Dummies Questions & Answers
hi all.
Please help me with archiving previous day syslog files.
the files have no extension and have the format YYYY-MM-DD.
I want to archive the file then move it to some other machine.
thanks. (2 Replies)
Discussion started by: coolatt
2 Replies
3. Shell Programming and Scripting
Hi
I am Trying to Write a script that can goto 4 different directorys on the server & remove the Files older then 30 days ??
/logs
logs1 logs2 logs3
Now I need to remove files under
logs1 logs2 logs3 which are older then 30 days whose name stat 'sit' , 'mig','bld' .
in... (3 Replies)
Discussion started by: Beginner123
3 Replies
4. Shell Programming and Scripting
hi all,
here is the description to my problem.
input parameter: $date1
based on the date i need to select three files starting with audit.log* based on its modified date, a date before, a date after(if its exists). We need to compare the input date to modified date of the file. And then... (3 Replies)
Discussion started by: ashrocks
3 Replies
5. Linux
Hi Team,
I have over 1 lakh pdf files.
I want to create folders like Disk-1, Disk-2 ..... & want to move 3000 pdfs per folder. Can i do it by script? Please help me.
Thanks & Regards
Parag Nehete (4 Replies)
Discussion started by: paragnehete
4 Replies
6. Shell Programming and Scripting
Hi All,
Am new to both Unix & this Forum - Need some help on a script that I am trying to write:
In a Directory i have few text files which might or might not contain some text that I am trying to find.
Once that text is found in any of the files, it needs to be removed from the file
... (6 Replies)
Discussion started by: rituparna_gupta
6 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
I have a large amount of files that I need to copy from one server to another server using SFTP. Can comeone please help me with the command I would use here?
Here is what I am thinking, but being new at this I know this is probably wrong:
Login to the destination host using... (1 Reply)
Discussion started by: SalientAnimal
1 Replies
8. Shell Programming and Scripting
Hi all,
i have a folder, with tons of files containing as following,
on /my/folder/jobs/
some_name_2016-01-17-22-38-58_some name_0_0.zip.done
some_name_2016-01-17-22-40-30_some name_0_0.zip.done
some_name_2016-01-17-22-48-50_some name_0_0.zip.done
and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
Daily i am doing the house keeping in one of my server and manually moving the files which were older than 90 days and moving to destination folder.
using the find command . Could you please assist me how to put the automation using the shell script .
... (11 Replies)
Discussion started by: venkat918
11 Replies
10. Shell Programming and Scripting
I've got this script to loop through all folders and move files that are more than 2 years old. I'm using the install command because it creates the necessary directories on the destination path and then I remove the source. I'd like to change the script to use the mv command since it is much... (4 Replies)
Discussion started by: consultant
4 Replies
LEARN ABOUT SUNOS
tiffsplit
tiffsplit(1) User Commands tiffsplit(1)
NAME
tiffsplit - split a multi-image TIFF into single-image TIFF files
SYNOPSIS
tiffsplit src.tif [prefix]
DESCRIPTION
tiffsplit splits a multi-directory (page) TIFF file to create one or more single-directory (page) TIFF files. The output filenames are cre-
ated by concatenating a prefix, a lexically ordered suffix in the range [aa-zz], and the suffix .tif. For example, xaa.tif, xab.tif, ...,
xzz.tif. If a prefix is not specified on the command line, the default prefix x is used.
OPTIONS
None
OPERANDS
The following operands are supported:
src.tif The name of the input file.
prefix The prefix used to create the output filenames.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWTiff |
+-----------------------------+-----------------------------+
|Interface stability |External |
+-----------------------------+-----------------------------+
SEE ALSO
tiffinfo(1), tiffcp(1), libtiff(3)
NOTES
Only a select set of "known tags" is copied when splitting.
Updated by Breda McColgan, Sun Microsystems Inc., 2004.
SunOS 5.10 26 Mar 2004 tiffsplit(1)