07-13-2009
bash - batch processing folder of files by name
Hello Everyone!!!
I need some help with a shellscript to batch process a folder of files with the imagemagick convert -append/+append command. The folder contains some hundred or thousand of small images in .png format which I would like to join together in order of their filenames. The filenames follow a pattern like this:
File 1: 11.123456_8.043589.png
File 2: 11.123456_9.320411.png
File 3: 12.843211_8.043589.png
File 4: 12.843211_9.320411.png
What I want to do is join all files with the same number in the first part of the filename (before the underscore) with the convert +append command to a row and afterwards join these rows together with the convert -append comand. This could also be a second script, if easier.
I figured out the imagemagick part of this, but as an absolute beginner to shellscripting, I have no clue how to get a appropriate shellscript up and running. I have searched the forum but didn't find anything that worked out for me or pointed me in the right direction. I would really appreciate some help here!
Greetings,
Gerd
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
so i have hundreds of files named history.20071112.tar
(history.YYYYMMDD.tar)
and im looking to extract one file out of each archive called status_YYYYMMDDHH:MM.lis
here is what i have so far:
for FILE in `cat dirlist`
do
tar xvf $FILE ./status_*
done
dirlist is a text... (4 Replies)
Discussion started by: kuliksco
4 Replies
2. Shell Programming and Scripting
Hi All,
I want to process consecutive jobs in a sequence but when I execute 1 job ,the control does not return to the command prompt to continue with the next job.
Can anyone help me here?
Thanks (3 Replies)
Discussion started by: Taranjeet Singh
3 Replies
3. Shell Programming and Scripting
Bash/scripting newbie here - I feel this might be a trivial problem, but I'm not sure how to tackle it. I've got a folder of a year's worth of files, with some random number of files generated every day of the year (but at least one per day). I'm writing a script to automatically grab the file with... (6 Replies)
Discussion started by: WildGooseChased
6 Replies
4. UNIX for Dummies Questions & Answers
Hi.
I don't have any experience with making scripts in bash. I need a simple script to rename all files in a folder to the format file1.avi, file2.avi, file3.avi, and so on.....
Please note that the original files have different filenames and different extensions. But they all need to be... (2 Replies)
Discussion started by: dranzer
2 Replies
5. Shell Programming and Scripting
Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below.
I am on a solaris server btw.
Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose.
... (2 Replies)
Discussion started by: goddevil
2 Replies
6. Shell Programming and Scripting
Hello,
I have a UNIX script to sftp batch processing. Here is my sftp command.
ftp -b toopc userid@sftp.hostname.com
In the file toopc I have the following commands:
mget *.csv
bye
This brings in all files with an extension of .csv
However, I need to only bring in files that
... (6 Replies)
Discussion started by: schlinzj
6 Replies
7. Shell Programming and Scripting
Hi,
I'm using awk command in bash script. I'm able to pass multiple files to awk for processing.The code i can use is as below(sample code)
#!/bin/bash
awk -F "," 'BEGIN {
...
...
...
}' file1 file2 file3
In the above code i'm passing the file names manually and it is fine till my... (7 Replies)
Discussion started by: shree11
7 Replies
8. Shell Programming and Scripting
I have some 50+ files in the following format :
abcd_vish_running_ZEBRA_20140818.dat_08-14-2014_23:08:23
abcd_vish_running_ZEB-RA_20140818.dat_08-14-2014_23:08:35
abcd_vish_running_ZEB_RA_20140818.dat_08-14-2014_23:08:37
abcd_vish_running_RI-NG_20140818.dat_08-14-2014_23:08:42... (5 Replies)
Discussion started by: SriRamKrish
5 Replies
9. UNIX for Beginners Questions & Answers
I am newish to the site and to unix.
I have a functioning interactive script running on Mac that sorts and processes files located in an unsorted folder on my desktop.
As it currently stands, the user types jpg into the command line, the script executes and iterates through the unsorted... (8 Replies)
Discussion started by: Braveheart
8 Replies
10. Shell Programming and Scripting
Im looking for 2 Files -> *.WAV and *.wav with
find . -name 'unavail.wav' -o -name 'unavail.WAV' I need to list the Folders that contains these 2 Files?
Thx in advance (13 Replies)
Discussion started by: valdez
13 Replies
PNGNQ(1) User Manuals PNGNQ(1)
NAME
pngnq - quantize png images
SYNOPSIS
pngnq [-vfhV][-s sample_factor ][-Q dither ][-g gamma ][-e extension ][-d dir ][-n colors ][ inputfiles ]
DESCRIPTION
pngnq quantizes a 32-bit RGBA PNG image to an 8 bit RGBA palette PNG using the neuquant algorithm. The output file name is the input file
name extended with "-nq8.png" or a specified extension.
OPTIONS
-v Verbose mode. Prints status messages.
-f Force overwriting of files.
-s sample factor
Sample factor. The neuquant algorithm samples pixels stepping by this value. The default value of 3 gives good results. Higher val-
ues sample less of the image pixels and thus are faster but less accurate. A factor of 1 samples every image pixel.
-n colors
Specifies the number of colors to quantize to. Defaults to 256 which is the maximum. The minimum here is 2.
-Q dither
Choose a dithering method: n = no dither (default), f = Floyd Steinberg dithering.
-g gamma
Set the image gamma correction. If not present, uses the png file's gamma or defaults to 1.0.
-e extension
Specifies the new filename extension. Defaults to "-nq8.png". Pngnq drops .png from the original filenames. If you set the argument
of the -e option to .png and choose the -f option the input file will be overwritten.
-d dir Tells pngnq to put output files in a directory other than the one the input files are in.
input files
The png files to be processed. Defaults to standard input if not specified. If standard input is being processed the output is sent
to standard output.
-h Print program help.
-V Print version number and library versions.
BUGS
Does not deal correctly with greyscale alpha images with low bit depths, but these wont benefit from quantizing.
AUTHOR
Stuart Coyle <stuart.coyle@gmail.com>
SEE ALSO
png(5)
Linux MAY 2009 PNGNQ(1)