In Yahoo! Pipes, how do I take a string from item.description and copy it to item.title?

扶醉桌前 提交于 2019-12-08 09:23:48

问题


Okay, so I already have a Pipe where I extracted the string I need from item.description, using the Loop and String Regex modules, and am emitting the results with the "emit results" option. Now, where do I go from here?

EDIT: Since an example was requested, here is one:

The item.title is "NBA Game: Lakers vs. Clippers" and the item.description is "The game went into overtime. The final score was 110-90." So the I'd like to extract "110-90" and copy it to the title, where it would then be "... Clippers (110-90)".


回答1:


1/ Put the score in "scorefield"

Rename operator: [item.description] [COPY AS] [scorefield]

Regex operator : in [scorefield] replace [.*\(([^)]+)\).*] with [$1]

2/ Append score to item.title

Regex operator : in [item.title] replace [($)] with [$1 ${scorefield}]


Nota :

In the above lines the outside square brackets are to be omitted unless noted otherwise

For complements :

http://beckism.com/2009/04/yahoo_pipes/

https://brooksbayne.wordpress.com/2009/01/11/using-regular-expressions-with-yahoo-pipes/



来源:https://stackoverflow.com/questions/8932622/in-yahoo-pipes-how-do-i-take-a-string-from-item-description-and-copy-it-to-ite

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!