Indesign软件中的Grep Line break

时间:2015-03-22 14:41:09

标签: grep

在indesign中GREP可以帮助打破界限

示例:(下面是格式我希望grep帮我打破免费赠品和平等线)可能吗?

You and your guest are invited to enjoy one complimentary
MAIN COURSE when a MAIN COURSE
of equal or greater value is purchased.

1 个答案:

答案 0 :(得分:0)

如果我理解你的问题,你有一个长行如下:

You and your guest are invited to enjoy one complimentary MAIN COURSE when a MAIN COURSE of equal or greater value is purchased.

您希望将这条长行分成以下三行:

You and your guest are invited to enjoy one complimentary
MAIN COURSE when a MAIN COURSE
of equal or greater value is purchased.

然后sed就是你想要的,而不是grep

sed -e 's/COURSE\sof/COURSE\nof/' -e 's/complimentary\s/complimentary\n/'

用法:

sed -e ... -e ... <<<"Your long line"

echo "Your long line" | sed -e ... -e ...

其中 ...是上面的表达式1和2(例如's/COURSE\sof/COURSE\nof/'