INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: How to clean the capitalization of descriptions?  (Read 1633 times)

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
How to clean the capitalization of descriptions?
« on: May 14, 2016, 02:02:57 am »

The library 'clean file proerties' is great.
But I have overused its 'fix capitalization' feature, applying it as 'title case' for everything including the description.
It's too long ago so I cannot simply go back to a previous state of my library.

I just tried the option 'first word' only for the description. It's not bad, but it only puts in capital the first letter of the very first word, and not the first word of every sentence.

What can I do?
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: How to clean the capitalization of descriptions?
« Reply #1 on: May 14, 2016, 09:36:48 am »

I just spent a few minutes and developed an expression to help with this.  It's no where near a full solution, but you might get some use out of it.  This expression will take whatever is in the [Description] column and try to capitalize the first word of each sentence.

It's very crude and repetitive as you can see.  It's designed to work on up to 5 sentences, which should cover a lot of cases.  It could easily be extended to 6, 7, 8, etc sentences with more cut and paste in the expression.  It is NOT smart enough to detect words that contain "." like Dr. Sr. Jr. etc.  It doesn't seem to handle paragraph breaks at all.

Make this an expression column and see if it helps you out at all.

Code: [Select]
regex([Description], /#([^.]+\.\s*)([^.]+\.\s*)?([^.]+\.\s*)?([^.]+\.\s*)?([^.]+\.\s*)?#/,-1,0)fixcase([R1],2) fixcase([R2],2) fixcase([R3],2) fixcase([R4],2) fixcase([R5],2)
Good luck.

Brian.
Logged
Pages: [1]   Go Up