Parse CSV fields with Extra Space

Got an idea, post it here

Parse CSV fields with Extra Space

Postby CiXel on Sun Mar 30, 2008 2:53 am

Presently, CSV imported fields such as:
Comedy,Crime,Thriller

Are parsed into:
Comedy/Crime/Thriller

I would like to propose they when they are parsed, instead of doing a straight 1:1 replacement of comma for backslash, that a space is also added, either on the right side or one on each side.

The reason here is if a field like that happens to wordwrap down to the next line in a box, it will cut off what we see as a 'word' because with no separation, the wordwrap treats it like one long word. Under the current conditions, depending on the size of your text box you could get something like this:
Comedy/Crime/Thri
ller


A more appropriate behavior would be something akin to this:
Comedy/ Crime/
Thriller


which this modification would address.
CiXel
 
Posts: 177
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Re: Parse CSV fields with Extra Space

Postby S Pittaway on Mon Mar 31, 2008 8:20 am

i have a plugin which does it (amoung other things....)
.
.
same as another post
.
.


let me know if you want a copy :)
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: Parse CSV fields with Extra Space

Postby CiXel on Mon Mar 31, 2008 7:51 pm

I cannot seem to find the parameter that would parse the existing genres with the " / " in place of "/" with any of the database append routines.
I can add or replace a global genre, but I can't seem to specify the "/" as " / "

A little direction perhaps?

database append (add)
Description: This can be used to build a / separated string (for things like genres)
CiXel
 
Posts: 177
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Re: Parse CSV fields with Extra Space

Postby S Pittaway on Tue Apr 01, 2008 9:46 am

sorry mis-understood what you wanted to do, i made the separator a parameter in the ini-file:

[Settings]
Format Separator = " /"

i will upload it later.


Sean.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: Parse CSV fields with Extra Space

Postby S Pittaway on Wed Apr 02, 2008 12:29 pm

i added Format Separator = " / " to the ini file setting.

you have to use " / " to get it to split the text neatly tho...
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: Parse CSV fields with Extra Space

Postby CiXel on Wed Apr 02, 2008 4:26 pm

S Pittaway wrote:i added Format Separator = " / " to the ini file setting.

you have to use " / " to get it to split the text neatly tho...

Great...
So here's my question: How can you apply the just the separator ie. " / " to the existing genres / information?
I can get it to work now by setting append 'remove' a non-existent field ie:
movies>genre>lalalalalalalalala

Which will do its magic, but only on a single item as there doesn't seem to be a global option.
Do we need to add an append (remove to all) function? Am I missing a simpler option?
CiXel
 
Posts: 177
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Re: Parse CSV fields with Extra Space

Postby S Pittaway on Wed Apr 02, 2008 5:05 pm

have a look at database add extra tags and Genre - Tidy = true
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: Parse CSV fields with Extra Space

Postby CiXel on Wed Apr 02, 2008 7:01 pm

S Pittaway wrote:have a look at database add extra tags and Genre - Tidy = true

Ah Ha. I hadn't considered just rebuilding. Thanks the ticket. It's all done in one step. Beautiful.

While not necessarily the proper forum, let me just take the time to thank you for addressing at least 3 feature requests in as many days :D
CiXel
 
Posts: 177
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York