- 论坛徽章:
- 0
|
本帖最后由 softiger 于 2016-04-25 19:18 编辑
有文本内容如下:
43,#2603902,04/20/2016 19:19:47,04/20/2016 20:21:03,J2-P750-E8B-SN06FAC3P,"Error Log Analysis has detected multiple communication errors. These errors can be caused by attached devices, a switch, a hub, or a SCSI-to-FC convertor. If connected to a switch, refer to the Storage Area Network (SAN) problem determination procedures for additional problem resolution. If not connected to a switch, run diagnostics on the attached devices. If a hub or SCSI-to-FC convertor is attached, refer to the product documentation for problem resolution.",04/20/2016 19:19:47,04/20/2016 19:29:07
50,10001522,04/25/2016 15:43:27,04/25/2016 15:43:27,I2_Server-8233-E8B-SN06E4C5R,ACT04293I Power/Cooling subsystem & control (0x61) reported an error.,04/25/2016 15:43:27,04/25/2016 15:52:08
它的规律是
如果中间的一段用双引号""包含起来的内容,则引号内的内容包含有逗号,
如果中间的内容没用""包含起来,则他的那部分内容不包含有逗号。
导致无法直接用逗号来分割获取需要分割的内容,需求是希望切割的内容是
43,--$1
#2603902,---$2
04/20/2016 19:19:47,--$3
04/20/2016 20:21:03,--$4
J2-P750-E8B-SN06FAC3P,--$5
"Error Log Analysis has detected multiple communication errors. These errors can be caused by attached devices, a switch, a hub, or a SCSI-to-FC convertor. If connected to a switch, refer to the Storage Area Network (SAN) problem determination procedures for additional problem resolution. If not connected to a switch, run diagnostics on the attached devices. If a hub or SCSI-to-FC convertor is attached, refer to the product documentation for problem resolution.",--$6
04/20/2016 19:19:47,--$7
04/20/2016 19:29:07--$8
50,--$1
10001522,--$2
04/25/2016 15:43:27,--$3
04/25/2016 15:43:27,--$4
I2_Server-8233-E8B-SN06E4C5R,--$5
ACT04293I Power/Cooling subsystem & control (0x61) reported an error.,--$6
04/25/2016 15:43:27,--$7
04/25/2016 15:52:08--$8
使得可以用;分割$1;$2;$3;$4;$5;$6;$7;$8
|
|