I have log file for checking transactions, and I have error lines, so I need those error lines to be exported to a .csv file? is there any code using linux bash shell script can do this?
Advertisement
Answer
suppose your error lines consists ERROR. then
grep "ERROR" errorfile.txt | tr -s '[:blank:]' ',' >> errorfile.csv
csv conversion is based on blank spaces to each cell.you can replace blank filter with anything