我正在使用Rad工具(使用.NET框架)和XML来解析数据文件。
我遇到了必须一分为二的特定行。格式是:(#之后只是用来传递列和数据)
Drive Name UNE Con Accessible by Drive status # column names
A L D 0 A,B Storage Subsystem Optimal # Data row 1
1 1 A Storage Subsystem Optimal # Data row 2第一行:
A L D 0 A,B Storage Subsystem Optimal 需要在格式中分成两行:
A L D 0 A Storage Subsystem Optimal
A L D 0 B Storage Subsystem Optimal以使单线性RE以以下格式显示提取的数据:
Drive Name UNE Con Accessible by Drive status
A L D 0 A Storage Subsystem Optimal
A L D 0 B Storage Subsystem Optimal
1 1 A Storage Subsystem Optimal发布于 2012-10-09 02:57:58
应将制表符作为2列之间的分隔符。
$string =~ s/([a-zA-Z0-9]+)\t([a-zA-Z0-9 ]+)\t(([a-zA-Z0-9 ]+),([a-zA-Z0-9 ]+))\t([a-zA-Z0-9 ]+)\t([a-zA-Z0-9 ]+)/$1\t$2\t$4\t$6\t$7\n$1\t$2\t$5\t$6\t$7/gshttps://stackoverflow.com/questions/11288441
复制相似问题