page

Jun 8, 2020

How to replace dot in linux

https://stackoverflow.com/questions/27205566/how-to-replace-dot-in-linux


# substitute . to NA

awk 'BEGIN {OFS=FS="\t"} {for (i=1;i<=NF;i++) {gsub(/^\.$/,"NA",$i)}}1' file

/^\.$/ to assure that nothing precedes or follows the dot

No comments:

Post a Comment