我知道是否可以生成使用ane的ruby代码
像这样ruby -a -F'Name“:” - '-ne
这是我的awk代码
awk -v OFS='"' -v FS='Name": "' '{ i2 = index($4, "\""); print ";" substr($4, 0, i2) }' sumacomando
我需要知道是否可以使用ruby one liner或ruby,这是有限的这项任务
只需要知道ruby中是否存在索引和子字符串的类似选项或者如果这个选项非常不同
基本上我只需要知道ruby在这个例子中是否具有类似awk的功能
请帮帮我
答案 0 :(得分:0)
我解决了它:
0 0 0 0 0 0 1 0 1 0 0 0 7 0 0 7 0 0 0 1 0 1 0 0
0 0 0 0 0 0 0 0 0 3 1 0 0 0 0 0 0 1 3 0 0 0 0 0
0 0 0 0 0 0 0 5 0 2 0 1 0 1 1 0 1 0 2 0 5 0 0 0
0 0 0 0 0 0 1 0 0 2 0 2 0 1 1 0 2 0 2 0 0 1 0 0
0 0 0 0 0 0 0 2 0 1 0 0 1 1 1 0 0 0 2 0 2 0 0 0
0 0 0 0 0 0 4 0 0 1 1 1 1 1 1 1 1 0 0 2 0 3 0 0
0 0 0 0 0 0 0 0 1 0 1 1 1 1 1 1 0 1 2 0 0 0 0 0
0 0 0 0 0 0 0 4 0 1 1 1 1 1 1 1 1 0 1 0 1 0 0 0
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 2 0 2 0 1 0 0 0
0 0 0 0 0 0 0 1 1 1 1 1 1 0 2 0 0 0 2 0 2 0 0 0
0 0 0 0 0 0 1 1 1 1 1 1 0 2 0 0 2 2 0 1 0 0 0 0
0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 3 0 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 5 1 1 4 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 4 0 0 2 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 3 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