我有一些数据需要解析为制表符分隔的文本文件。数据如下:
>beer/name: Sausa Weizen beer/beerId: 47986 beer/brewerId: 10325 beer/ABV: 5.00 beer/style: Hefeweizen review/appearance: 2.5
> review/aroma: 2 review/palate: 1.5 review/taste: 1.5 review/overall:
> 1.5 review/time: 1234817823 review/profileName: stcules review/text: A lot of foam. But a lot. In the smell some banana, and then lactic and
> tart. Not a good start. Quite dark orange in color, with a lively
> carbonation (now visible, under the foam). Again tending to lactic
> sourness. Same for the taste. With some yeast and banana.
>
> beer/name: Red Moon ...repeats millions of times...
在` 我需要它看起来像这样:
Sausa Weizen {tab} 47986 {tab} 10325 {tab} ...
有没有人有一些perl代码的例子,我可以用来开始?我对Perl还不熟悉,我在网站上找到了一些其他的例子,但无法让它们在我的上下文中工作。在
我尝试过在Vim中使用正则表达式,还尝试了以下perl:
^{pr2}$
在Perl中,有许多方法可以实现这一点,但我将给出最简单的方法:
相关问题 更多 >
编程相关推荐