BEGIN { OFS="\t"} NR%2 == 1 { # path split($0, A, "/") path = A[length(A)] next } NR%2==0 { # title title = $0 print NR/2, title, "Section", path next }