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 585 times)

mvandyke

  • World Citizen
  • ***
  • Posts: 157
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

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 956
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
Win NUC - VENOEN 11Th NUC Mini PC Core i7 1165G7,Dual HDMI 2.0+Mini DP,Windows 11 Mini Desktop Computer,Thunderbolt 4.0,1 Lan, USB-C,Wifi,Bluetooth 5.0,32GB RAM Toshiba MQ04ABF100 ‎500Gb 5400 RPM ‎eSATA HD, Gigabyte GP-GSM2NE3512GNTD 1Tb NVMe SSD, Samsung 870 QVO 8 TB SATA 2.5 Inch SSD (MZ-77Q8T0) in Sabrent Ultra Slim USB 3.0 to 2.5-Inch SATA External Aluminium Hard Drive Enclosure (EC-UK30)

Apple 2020 Mac mini M1 Chip (8GB RAM, 512GB SSD)
Sabrent Thunderbolt 3 to Dual NVMe M.2 SSD Tool-Free Enclosure with Sabrent 2TB Rocket NVMe PCIe M.2 2280 High Performance SSD + Crucial P3 Plus 4TB M.2 PCIe

ET Skins & TrackInfo Plugins - https://englishtiger.uk/index.html

mvandyke

  • World Citizen
  • ***
  • Posts: 157
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

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 956
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
Win NUC - VENOEN 11Th NUC Mini PC Core i7 1165G7,Dual HDMI 2.0+Mini DP,Windows 11 Mini Desktop Computer,Thunderbolt 4.0,1 Lan, USB-C,Wifi,Bluetooth 5.0,32GB RAM Toshiba MQ04ABF100 ‎500Gb 5400 RPM ‎eSATA HD, Gigabyte GP-GSM2NE3512GNTD 1Tb NVMe SSD, Samsung 870 QVO 8 TB SATA 2.5 Inch SSD (MZ-77Q8T0) in Sabrent Ultra Slim USB 3.0 to 2.5-Inch SATA External Aluminium Hard Drive Enclosure (EC-UK30)

Apple 2020 Mac mini M1 Chip (8GB RAM, 512GB SSD)
Sabrent Thunderbolt 3 to Dual NVMe M.2 SSD Tool-Free Enclosure with Sabrent 2TB Rocket NVMe PCIe M.2 2280 High Performance SSD + Crucial P3 Plus 4TB M.2 PCIe

ET Skins & TrackInfo Plugins - https://englishtiger.uk/index.html

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2376
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