原始数据文件-error528.txt,内容摘取如下:
9941 (Local) /home/zeos/gaojianyun/daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.c:201 FMM.MIGHT (2:Error) Analyze
21163 (Local) /home/zeos/gaojianyun/daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/fs/proc/version.c:76 MLK.RET.MIGHT (2:Error) Analyze
31816 (Local) /home/zeos/gaojianyun/daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/clk/clk-conf.c:37 MLK.MUST (2:Error) Analyze
31817 (Local) /home/zeos/gaojianyun/daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/clk/clk-conf.c:37 MLK.MUST (2:Error) Analyze
31818 (Local) /home/zeos/gaojianyun/daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/clk/clk-conf.c:40 MLK.MUST (2:Error) Analyze
……
第一步:取出路径和行号
awk '{print $3}' error528.txt > pathLine.txt
命令解析:将文件“error528.txt”中利用空格分隔的第三列摘取并输出到文件“pathLine.txt”。
pathLine.txt内容摘取:
/home/zeos/gaojianyun/daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.c:201
/home/zeos/gaojianyun/daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/fs/proc/version.c:76
/home/zeos/gaojianyun/daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/clk/clk-conf.c:37
/home/zeos/gaojianyun/daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/clk/clk-conf.c:37
/home/zeos/gaojianyun/daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/clk/clk-conf.c:40
……
第二步:去掉头部“/home/zeos/gaojianyun/”
awk -F '/home/zeos/gaojianyun/' '{print $2}' pathLine.txt > pathLine2.txt
命令解析:-F参数为自定义分隔符。以'/home/zeos/gaojianyun/'作为分隔符,将每列其后面部分输出到pathLine2.txt文件
pathLine2.txt内容摘取:
daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.c:201
daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/fs/proc/version.c:76
daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/clk/clk-conf.c:37
daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/clk/clk-conf.c:37
daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/clk/clk-conf.c:40
……
第三步:获取路径
awk -F : '{print $1}' pathLine2.txt > path.txt
命令解析:以“:”为分隔符,输出“:”前面部分到path.txt文件
path.txt内容摘取:
daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.c
daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/fs/proc/version.c
daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/clk/clk-conf.c
daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/clk/clk-conf.c
daily_1453/SQ/release/xitos/core/kw_build/tmp/work-shared/saic_imx6d_fota/kernel-source/drivers/clk/clk-conf.c
……
第四步:获取行号
awk -F : '{print $2}' path.txt > line.txt
命令解析:以“:”为分隔符,输出“:”后面部分到line.txt文件
line.txt内容摘取:
201
76
37
37
40
……