Sorting/Filed Defining/Output problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sorting/Filed Defining/Output problem
# 1  
Old 02-10-2007
Sorting/Filed Defining/Output problem

need a little help with a few tid bits. I wrote a script that checks the resoluion of image files and writes them out to a file then sorts the resolutions by largets Width. Then take the sorted files information and toss all the 835 widths into a seperate file. Ignore the redundancies its a nesscearry evil. What I cannot get it to do is print the Filename along with the resolution.

identify -verbose *.*|awk '/Geometry/{print($2)}'|awk -Fx '{print("*.* : "($1"x"$2))}'> /home/Main/resolution.txt
sort -n /home/Main/resolution.txt > /home/Main/sortres.txt
grep 835 /home/Main/sortres.txt > /home/Main/finalsort.txt

I used *.* to cover all of the images in the diectory, which is where I am running into problems. Since I used *.* I cannot seeme to print the file name along with the resolution. If there is a simpler way that my mind is not seeing or a different way to force identify to read all the images and spit out thier resolutions and name into a file let me know.
# 2  
Old 02-12-2007
Something like this,

Code:
while read filename
do
echo "Processing file $filename" > <outputfilename>
<your image processing command> $filename | <further operations>   >> <output filename>
done < list_of_files_to_process

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Defining variable problem

Hi I'd say I'm having this weird problem where my script isn't taking the value off a variable or printing it. My code is like this: set count_C= `grep -c C mols` set count_H= `grep -c H mols` set count_O= `grep -c O mols` sed -i '7,7 s/$/ $count_C $count_O $count_H/g' input It... (8 Replies)
Discussion started by: saleheen
8 Replies

2. Shell Programming and Scripting

sorting output of echo

can someone please tell me who to sort the numerical output of echo? UIO="8180 0 0 0 0 0 0 0 0 0 0 48240 48240 48240 48240 48240 48240 0 0 0 0 0 0 0 48300 0 0 0 48300" echo $UIO | sort -n This doesn't workk. it does not sort the numbers from smallest to highest. any ideas? (2 Replies)
Discussion started by: SkySmart
2 Replies

3. Programming

Problem defining a struct

I have the following code and getting the compilation errors baseLib/DynBaseObj.h:80: error: expected constructor, destructor, or type conversion before ‘(' token baseLib/DynBaseObj.h:89: error: expected constructor, destructor, or type conversion before ‘(' token baseLib/DynBaseObj.h:101:... (0 Replies)
Discussion started by: kristinu
0 Replies

4. UNIX for Dummies Questions & Answers

Help Needed with Sorting Output

Hi all, I'm using Solaris 10, and need help in sorting the below output from the syslog file in descending rather than ascending order. I would like both the hostname and message columns to be sorted, but right now only the message is sorted and the count column, whose order I would like... (2 Replies)
Discussion started by: wthomas
2 Replies

5. Shell Programming and Scripting

alias defining problem in .cshrc file

Hi folks, I'm trying to define the following command as alias in .cshrc file: ls -ltr | grep ^d | awk '{print $9}' | xargs du -hs I defined it as the following: alias nirdirs '`ls -ltr | grep "^d" | awk "{print \\$9}" | xargs du -hs`' I've got the following error when I've run the alias:... (7 Replies)
Discussion started by: nir_s
7 Replies

6. Solaris

Problem defining remote printers on solaris 10

Good morning, I have a server with solaris 10 that I want to intall remote printers. I started lpsched deamon without problems with command: svcadm enable application/print/server I want to install printers that are defined locally on print server, so: lpadmin -p <device> -s <print... (2 Replies)
Discussion started by: bonovox
2 Replies

7. UNIX for Dummies Questions & Answers

sorting cksum output.

Hi guys, I have a service directory with a lot of files in. I have to cksum the whole directory and compare it to a release note document. However the problem I have is the files are listed in different lines when running cksum as they are in the release doc. Therefore cksum shows... (1 Reply)
Discussion started by: Stin
1 Replies

8. Shell Programming and Scripting

sorting output

hi, I get an output like uid=user1 gecos=user uid=user2 gecos=admin gecos=sol admin uid=user3 uid=user4 gecos=sol, admin and need it modified to: uid=user1 gecos=user (3 Replies)
Discussion started by: funksen
3 Replies

9. Shell Programming and Scripting

Sorting problem "sort -k 16,29 sample.txt > output.txt"

Hi all, Iam trying to sort the contents of the file based on the position of the file. Example: $cat sample.txt 0101020060731 ## Header record 1c1 Berger Awc ANP20070201301 4000.50 1c2 Bose W G ANP20070201609 6000.70 1c2 Andy CK ANP20070201230 28000.00... (3 Replies)
Discussion started by: ganapati
3 Replies
Login or Register to Ask a Question