我想使用sed命令删除文件中最后一次出现的"(* cds_ams_schematic *)“。
`view schematic
`timescale 1ns / 1ns
(* cds_ams_schematic *)
module ...
endmodule
// LAST TIME SAVED: Sep 9 12:14:07 2022
// NETLIST TIME: Dec 13 09:13:34 2022
`view schematic
`timescale 1ns / 1ns
(* cds_ams_schematic *)
module ...
inout N, P, sub;
endmodule
// LAST TIME SAVED: Oct 10 14:16:33 2022
// NETLIST TIME: Dec 13 09:13:34 2022
`view schematic
`timescale 1ns / 1ns
(* cds_ams_schematic *)
module ...
inout PAD;
endmodule
`view schematic_incisiv
`timescale 1ns / 1ns
(* cds_ams_schematic *)
`noworklib
`noview我试过命令
sed -rn 's/[(][*]\scds_ams_schematic\s[*][)]//' sample_txt_file.txt然而,它没有起作用。有什么想法吗?
发布于 2023-01-04 13:36:48
您可以尝试这个命令(参考文献)
tac input.txt | awk '!found && /(\* cds_ams_schematic \*)/{found=1;next}1' | tac > output.txthttps://askubuntu.com/questions/1447485
复制相似问题