Skip to content

Instantly share code, notes, and snippets.

@masakiplus
Created January 19, 2013 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masakiplus/4572623 to your computer and use it in GitHub Desktop.
Save masakiplus/4572623 to your computer and use it in GitHub Desktop.
#! /usr/bin/sh
INPUT_FILE=data1
OUTPUT_FILE=data2
awk -c '
BEGIN {
FS = "\t" # TAB chara fow win platform
OFS = "\t"
REC_N = 15 # column number
}
{
printf "%s", $0
n = REC_N - NF
for (i = 0 ; i < n ; ++i) {
printf "\t " # TAB chara for linux platform
}
printf "\n" # Enter chara for linux
}
' ${INPUT_FILE} > ${OUTPUT_FILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment