Nov 28, 2008 #1 cryptoadm MIS Nov 6, 2008 71 US 123 xyz abc ade 2324 lmn 689 vms hmn 321 tgh I need to format the output as the second line:first line - for exampe: xyz:123 abc: ade: lmn:2324 vms:689 hmn: tgh:321 Thanks!
123 xyz abc ade 2324 lmn 689 vms hmn 321 tgh I need to format the output as the second line:first line - for exampe: xyz:123 abc: ade: lmn:2324 vms:689 hmn: tgh:321 Thanks!
Nov 29, 2008 1 #2 PHV MIS Nov 8, 2002 53,708 FR A starting point: awk '!(NR%2){print $0":"x;next}{x=$0}' /path/to/input >output Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
A starting point: awk '!(NR%2){print $0":"x;next}{x=$0}' /path/to/input >output Hope This Helps, PH. FAQ219-2884 FAQ181-2886
Dec 3, 2008 1 #3 booke Technical User Oct 2, 2008 9 Try this: awk 'NF == 0 {next}; {if($0 ~ /^[0-9]/) {TMP1 = $0; if(getline TMP2 > 0) print TMP2":"TMP1}}; {if($0 ~ /^[a-z]/) print $0":"}' /filename Upvote 0 Downvote
Try this: awk 'NF == 0 {next}; {if($0 ~ /^[0-9]/) {TMP1 = $0; if(getline TMP2 > 0) print TMP2":"TMP1}}; {if($0 ~ /^[a-z]/) print $0":"}' /filename