【发布时间】:2019-12-19 20:43:39
【问题描述】:
我正在尝试从 Unix 文件中过滤掉多行 cmets。我们将使用该文件针对 Oracle 引擎运行
我尝试在下面使用,但它没有显示我想要的正确输出。
我的文件 file.sql 包含以下内容:
/* This is commented section
asdasd...
asdasdasd...
adasdasd..
sdasd */
I want this line to print
/* Dont want this to print */
/* Dont want this
to print
*/
Want this to
print
/*
Do not want
this to print
*/
我的输出需要如下所示::
I want this line to print
Want this to
print
我尝试使用下面的 perl 首先向我显示多行注释中的行,但它没有显示正确的输出:(
perl -ne 'print if //*/../*//' file.sql
我的主要目标是不显示多行注释行,而只显示前面提到的输出。
【问题讨论】:
标签: perl text-processing