INTERACT FORUM

Please login or register.

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

Author Topic: Creating Smartist to search for New Line Feed for Lyrics field  (Read 736 times)

mvandyke

  • World Citizen
  • ***
  • Posts: 159
Creating Smartist to search for New Line Feed for Lyrics field
« on: December 05, 2021, 09:35:20 am »

I have a large collection of audio music and many of my lyrics fields have wrong data in them based on adding the lyrics in in earlier versions before the "Lookup Lyrics" was more effecient.

Many of these files have a three periods, two spaces and then a new linefeed.  I would like to create a smartlist that would find these files but not sure how to enter the new line feed (known as hard carriage return in the old days) into the smartlist definition.

Attached are some examples of a "bad Lyric"

Any assistance on defining a new line feed would be appreciated.

Thanks
Matt
Logged

EnglishTiger

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1092
Re: Creating Smartist to search for New Line Feed for Lyrics field
« Reply #1 on: December 05, 2021, 11:28:48 am »

You can use Find and Replace to remove the "...  " by telling it to find "...  " and having an empty value in the replace box.

And the TrimLines Function to remove additional empty lines :-https://wiki.jriver.com/index.php/String_Manipulation_Functions
Logged
Apple Mac Mini Desktop Computer with M4 Pro chip with 12 core CPU and 16 core GPU: 24GB Unified Memory, 512GB SSD Storage, Gigabit Ethernet, 3 Thunderbolt5 + 2USBC ports.

mvandyke

  • World Citizen
  • ***
  • Posts: 159
Re: Creating Smartist to search for New Line Feed for Lyrics field
« Reply #2 on: December 05, 2021, 01:41:14 pm »

You can use Find and Replace to remove the "...  " by telling it to find "...  " and having an empty value in the replace box.

And the TrimLines Function to remove additional empty lines :-https://wiki.jriver.com/index.php/String_Manipulation_Functions


The problem is that the entire lyric is wrong.  Any individual lyric that has a line with the ... and then a new line feed does in fact have bad lyrics.  The scraping process that JRiver initially used was flawed and the line that has the ... is repeated twice within the next 5 or six lines. 

In the example - the entire first black box should not be there at all only the second one. 

If I can find a way to define a playlist with the ...  new linefeed I can then rerun all of those files and correct the bad lyrics.

Thanks
Matt
Logged

EnglishTiger

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1092
Re: Creating Smartist to search for New Line Feed for Lyrics field
« Reply #3 on: December 06, 2021, 01:08:15 am »

Unfortunately a Linefeed is a Linefeed is a Linefeed - so there is no way of differentiating between one in the Wrong Part of the Lyrics and one in the Right Part of the Lyrics.

The only way I can think of getting the Right Lyrics into those tracks is to expose the [Last Lyrics Lookup] field in the Smartlist
Select 10 of those tracks and empty their Lyrics and Last Lyrics Lookup Fields
and then Tell MC to Do a Lyrics Lookup.

Then rinse and repeat until you have done all of them
Logged
Apple Mac Mini Desktop Computer with M4 Pro chip with 12 core CPU and 16 core GPU: 24GB Unified Memory, 512GB SSD Storage, Gigabit Ethernet, 3 Thunderbolt5 + 2USBC ports.

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2620
Re: Creating Smartist to search for New Line Feed for Lyrics field
« Reply #4 on: December 06, 2021, 03:43:26 am »

It is possible to find the pattern you want. Add this as a "Custom" rule in a smartlist (or in MC's omnisearch bar):
Code: [Select]
[=compare(find([lyrics],.../ / char(13)),>=,0)]=1
This finds "...  \r". Note that depending on the source of these lyrics, the newlines may be a single \r character (char 13), a single \n character (char 10) , or a \r\n tuple as is the default in windows. So you may need to test char(10) on the expression as well. If you want to detect 2 newlines in a row, you may need to test these variations:
.../ / char(13)char(13)
.../ / char(10)char(10)
.../ / char(13)char(10)char(13)char(10)

Alternatively, let's use Regex to find all variants - this matches the 3 dots, followed by 1 or more spaces, followed by 1 or more of the newline chars:
Code: [Select]
[=regex([lyrics],\.{3} +[\r\n]+,0)]=1
Logged
Pages: [1]   Go Up