Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while IFS=$'t' read -r line ; do
- some code.. (to get the value of $some_var and $another_var)
- echo "$line" | awk -v var1="$some_var" -v var2="$another_var" -F $'t' 'BEGIN {OFS = FS} { $1=$var1 } ; {if($2!="") $2=$var2 }; { print }' >> file.tsv
- done < text.tsv
- File content:
- A B D
- 1 3 4
- Intended output
- H I D
- 6 3 4
- Output I get:
- D
- 3 4
- while IFS=$'t' read -r line ; do
- some code.. (to get the value of $some_var and $another_var)
- echo "$line"
- | awk -v var1="$some_var" -v var2="$another_var" -F $'t'
- 'BEGIN {OFS = FS}
- { $1=var1 }
- {if($2!="") $2=var2 }
- { print }' >> file.tsv
- done < text.tsv
Add Comment
Please, Sign In to add comment