I'm hoping one of the experts can help please. I have a text file that looks like this:
--- Start paste ---
[blackfordLane.jpg]
File name = BlackfordLane.jpg
Directory = C:\Docs\My Videos\PROJECTS\Thames Path Walk Projects\TP03 Project\Geograph Photos\GeoDay2\
Compression = JPEG, quality: 87, subsampling OFF
Resolution = 96 x 96 DPI
File date/time = 19/01/2012 / 15:01:23
- IPTC -
Object Name - s bridge over the River Thames is not a footbridge but carries pipes.
- COMMENT -
Thames Path on Blackford Lane heading towards Blackford Farm, east of Castle Eaton.
[Castle Eaton Church.jpg]
File name = Castle Eaton Church.jpg
Directory = C:\Docs\My Videos\PROJECTS\Thames Path Walk Projects\TP03 Project\Geograph Photos\GeoDay2\
Compression = JPEG, quality: 87, subsampling OFF
Resolution = 72 x 72 DPI
File date/time = 19/01/2012 / 14:03:55
- EXIF -
Make - FUJIFILM
Model - FinePix2600Zoom
Orientation - Top left
XResolution - 72
YResolution - 72
ResolutionUnit - Inch
- COMMENT -
Castle Eaton Church
[CastleEaton-2.jpg]
File name = CastleEaton-2.jpg
Directory = C:\Docs\My Videos\PROJECTS\Thames Path Walk Projects\TP03 Project\Geograph Photos\GeoDay2\
Compression = JPEG, quality: 75
Resolution = 0 x 0 DPI
File date/time = 18/01/2012 / 15:40:05
- COMMENT -
The Red Lion, Castle Eaton
A warm welcoming pub on a cold winter's day, with the River Thames running at the bottom of the garden.
And this is what I want to get as a result:
BlackfordLane.jpg
Thames Path on Blackford Lane heading towards Blackford Farm, east of Castle Eaton.
Castle Eaton Church.jpg
Castle Eaton Church
CastleEaton-2.jpg
The Red Lion, Castle Eaton
A warm welcoming pub on a cold winter's day, with the River Thames running at the bottom of the garden.
My first line of attack is to try for a Regex expression that will Find everything (for example) between the ']' of '[blackfordLane.jpg]' and the '-' of '- COMMENT -'? That would leave only a little tidying up, I think.
But so far it's eluded me after a couple of hours. The best I could come up with was the following to delete all lines from File name... to File date/time (with the Replace box empty):
File name = .*\nDirectory = .*\nCompression = .*\nResolution = .*\nImage dimensions = .*\nPrint size = .*\nColor depth = .*\nNumber of unique colors = .*\nDisk size = .*\nCurrent memory size = .*\nFile date/time = .*\n
But that's only part of the task and seems very inelegant.
Any suggestions please?
--
Terry, East Grinstead, UK