AIXSolarisAdmin
MIS
Text file example of about 150,000 lines:
I am using the colon as a delimiter.
However, I discovered that some records have a ":" in the third field:
How can I parse the fields using ":" because the third field is throwing me off?
Code:
1428590133:157:(scsi_eh_0):root:S:0:20:1:0:0.00:0.00:0.00:0.00:0.00:0.00:0.00:1:0:0:0:0:0:0:0:0:0:0
1428590133:158:(scsi_eh_1):root:S:0:20:1:0:0.00:0.00:0.00:0.00:0.00:0.00:0.00:1:0:0:0:0:0:0:0:0:0:0
I am using the colon as a delimiter.
However, I discovered that some records have a ":" in the third field:
Code:
1428595413:5316:(flush-253:10):root:S:0:20:1:0:0.00:0.00:0.00:0.00:0.00:0.00:0.00:0:0:0:0:0:0:0:0:0:0:0
1428595413:5317:(flush-253:11):root:S:0:20:1:0:0.00:0.00:0.00:0.00:0.00:0.00:0.00:0:0:0:0:0:0:0:0:0:0:0
1428595413:5355:(flush-253:0):root:S:0:20:1:0:0.00:0.00:0.00:0.00:0.00:0.00:0.00:1:0:0:0:0:0:0:0:0:0:0
How can I parse the fields using ":" because the third field is throwing me off?
Code:
timestamp=$1
pid=$2
cmd=$3
owner=$4
...