本帖最后由 pcl_test 于 2016-9-28 13:28 编辑
- #*第三方http://www.bathome.net/s/tool/index.html?key=gawk
- #*&cls&gawk -f "%~f0" "database.txt">"result.txt"&pause&exit
- BEGIN{
- print "HSA(D)\t\tDG(E)\t\tDrug(F)\t\tclassification";
- hsa="";
- dg="";
- }
- {
- if(match($0,/\[HSA:([^\[]*)\]/,d)){gsub(/[[:space:]]+/,",",d[1]);hsa=d[1];dg="~"}
- if(match($0,/\[DG:([^\[]*)\]/,e))dg=e[1];
- if(match($0,/[[:space:]]+(D[0-9]{5})[[:space:]]*.*[[:space:]]+(\S+)[[:space:]]*$/,drug)){
- print hsa"\t\t"dg"\t\t"drug[1]"\t\t"drug[2];
- }
- }
复制代码
|