Maintaining the separator in awk output
问题 I would like to subset a file while I keep the separator in the subsetted output using ´awk´ in bash. That´s what I am using: The input file is created in R language with: inp <- 'AX-1 1 125 AA 0.2 1 AB -0.89 0 AA 0.005 0.56 AX-2 2 456 AA 0 0 AA -0.56 0.56 AB -0.003 0 AX-3 3 3445 BB 1.2 1 NA 0.002 0 AA 0.005 0.55' inp <- read.table(text=inp, header=F) write.table(inp, "inp.txt", col.names=F, row.names=F, quote=F, sep="\t") (So fields are separated by tabs) The code in bash: awk {'print $1 $2