LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 01-05-2020, 10:28 PM   #16
individual
Member
 
Registered: Jul 2018
Posts: 315
Blog Entries: 1

Rep: Reputation: 233Reputation: 233Reputation: 233

Quote:
Originally Posted by michaelk View Post
Individual's script fails because the file output is different from the expected regex expression. What compounds the problem is that there are two different aaxbb stings in the output.

Not enough information provided to be certain why the original script fails to find some files. It maybe caused if copying files to a directory within the original working search directory.
Yes, I failed to take into account file printing any metadata associated with the image, e.g. density, that is in the form WWxHH. The regex could be tweaked to handle those edge cases:
Code:
'(?<=, )\d+[ x]+\d+(?=,)'
An explanation for the OP:
Match a leading comma with a space, followed by one or more digits, followed by an optional space, the letter 'x', another optional space, one or more digits, and finally a trailing comma.

Here are some example output resolutions for images I tested with:
Code:
1920x1200
1920 x 1080
1920x1080
1680 x 1050
One caveat: you won't be able to match the resolution of a .tiff file using this regex.

Last edited by individual; 01-05-2020 at 10:29 PM. Reason: Wording.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
question: 'onclick' within 'onmouseover' within 'form' within 'table' - how is it possible? rblampain Programming 4 04-25-2017 08:49 PM
find specific named directory while excluding specific named directory sharky Linux - Newbie 6 01-17-2014 11:29 AM
Copy a directory into another directory while ignoring specific directories or files wh33t Linux - Newbie 14 05-16-2012 08:13 PM
[SOLVED] Finding images based on their dimensions Huwie Linux - Newbie 4 11-06-2010 03:03 AM
[SOLVED] Need to copy all .jpg images in subdirectories to a specific directory sikanders Linux - Newbie 5 08-06-2010 07:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration