Bash script that analyzes report files

前端 未结 3 2009
伪装坚强ぢ
伪装坚强ぢ 2021-01-22 08:54

I have the following bash script which I will use to analyze all report files in the current directory:

#!/bin/bash    


# methods
analyzeStructuralErrors()
{ 
         


        
3条回答
  •  深忆病人
    2021-01-22 09:17

    As suggested by Dave Jarvis, awk will:

    • handle this better than bash
    • is fairly easy to learn
    • likely available wherever bash is available

    I've never had to look farther than The AWK Manual.

    It would make things easier if you used a consistent field separator for both the list of column names and the data. Perhaps you could do some pre-processing in a bash script using sed before feeding to awk. Anyway, take a look at multi-dimensional arrays and reading multiple lines in the manual.

提交回复
热议问题