You can try:
awk -f f.awk input.txt
where input.txt
is you input data file, and f.awk
is:
/Identifiers Found/{
id[++j]=$4
while($1 != "") {
getline
id[++j]=$1
}
}
/^Device/ {
getline
getline
while ($1 != "") {
i++
if (NF==3) {
dev[i]=$1
dir[i]=$3
}
else {
dev[i]=$1
dir[i]=$4" "$5
}
getline
}
}
END {
if (i>j) n=i
else n=j
fmt="%-7s | %-12s| %-17s\n"
printf fmt, "Device", "Dir:P", "Identifiers Found"
printf fmt, "-----", "-----", "-----------------"
for (i=1; i<=n; i++)
printf fmt, dev[i],dir[i],id[i]
}