INTERACT FORUM

More => Old Versions => Media Center 17 => Topic started by: Phydeaux on January 27, 2013, 02:21:00 pm

Title: Using JRiver Expressions to remove newlines
Post by: Phydeaux on January 27, 2013, 02:21:00 pm
I am trying to create an expression column to use "AtomicParsley" to add the relevant tags that J River finds to the mp4/m4v files so that they can be imported into iTunes and be viewed on my Apple TV.

I have the following expression:

Code: [Select]
AtomicParsley.exe "[Filename]" --genre "TV Shows" --stik "TV Show" --title "[Name]" -H "[Series]" -I "S[Season]E[Episode]" -U [Season] -N [Episode] --description "[Description]" --overWrite
The thought is that I can then extract this information and run it from the command line. It works except for the 'Description' field which occasionally contains new lines characters. Is there any way to get rid of these? I imagine that the "Replace(...)" function is what I'm looking for, but can't figure out how to search for a newline character.

Any suggestions?

Philip
Title: Re: Using JRiver Expressions to remove newlines
Post by: MrC on January 27, 2013, 02:30:21 pm
Try using the Clean() function.  It will replace newlines and other unprintables with a space character for each.
Title: Re: Using JRiver Expressions to remove newlines
Post by: Phydeaux on January 27, 2013, 10:20:44 pm
Unfortunately, that also removes a number of other useful characters, such as a ?. I will copy and paste to Excel for now and use some creative filtering.
Title: Re: Using JRiver Expressions to remove newlines
Post by: MrC on January 28, 2013, 12:40:50 pm
Since you're doing this to produce essentially a command line, let me suggest instead that you build your command line in a command line environment.  Use MCWS to obtain the field values you want.  In that environment, you can use whatever tools you want to massage the data.

For what I think you're doing, I'd use perl or Cygwin.
Title: Re: Using JRiver Expressions to remove newlines
Post by: MrC on January 29, 2013, 02:19:07 am
It also occurred to me later you could use Hexify().  It will convert newlines into hex values safe for URLs.  It will convert other characters too, but you can change them back.  For example:

   replace(
       replace(
          Hexify([description]),
       %20, / ),
   %3F, ?)