fork download
  1. #!/bin/bash
  2. s='id first_name last_name age address telephone item1 tax1 item2 tax2 item3 tax3'
  3. awk '{for (i=7; i<NF; i+=2) print $1, $2, $3, $4, $5, $6, $i, $(i+1)}' <<< "$s"
  4.  
Success #stdin #stdout 0.01s 5516KB
stdin
Standard input is empty
stdout
id first_name last_name age address telephone item1 tax1
id first_name last_name age address telephone item2 tax2
id first_name last_name age address telephone item3 tax3