grep/egrep 中是否有办法从该文本中提取棘手的模式,将它们插入行的开头及其剩余行,使其看起来如下所示?
从许多包含“非特定”一词的文件中提取的原始文本。现在我需要组织这些,使名称从行首开始,以便于阅读。在它们之间插入一个空行也会有所帮助,但这在 egrep 中可能是不可能的?
输入:
SofasCouchesChairs/Type1234567.xml:Nonspecific Couch-W ISSUESTablesDesks/Type123765.xml:Nonspecific Tables issues BedsDivans/Type4567345.xml:Nonspecific bed abnormalitiesBedBugs/Type2893993.xml:Nonspecific bugs in the spring boxes related to the mattressBed_Sofas/Type1317994.xml:Nonspecific WR abnormalities these are from Radios_TV/Type1274978.xml:radiation perhaps with nonspecific cell phones and cell towers Cabinets_TelephoneWires/Type1299691.xml:DATA:all kinds of nonspecific cell phone wave changes, with a
预期输出:
SofasCouchesChairs/Type1234567.xml:Nonspecific Couch-W ISSUES
TablesDesks/Type123765.xml:Nonspecific Tables issues
BedsDivans/Type4567345.xml:Nonspecific bed abnormalities
BedBugs/Type2893993.xml:Nonspecific bugs in the spring boxes related to the mattress
Bed_Sofas/Type1317994.xml:Nonspecific WR abnormalities these are from
Radios_TV/Type1274978.xml:radiation perhaps with nonspecific cell phones and cell towers
Cabinets_TelephoneWires/Type1299691.xml:DATA:all kinds of nonspecific cell phone wave changes, with a