awk Script

I am trying a script where i awk the output text file to a csv file

Attached are the input file , I am a newbie at bash scripting

Input Text file




awk '
/NE name:/ {
        n = $4
}		
/System Name:/ {
        r = $4
}		
/System Name: / {
        p = $3  $4  $5  $6		
		print n , r , p


		
}' OFS=, /cygdrive/c/output/LLDP/output.txt >>$i

Desired CSV output


AA2M3A 	172.17.168.226	 ER_3898_1_FON	Huawei RTN 980
AA2M3A        172.17.168.226	ER_3898_1_FON	        Huawei RTN 980
ABHM7a 	172.17.167.2	         HCX16.01          	        Huawei Versatile Routing Platform Software
ABHM7a 	172.17.167.2	         HCX16.02	                Huawei Versatile Routing Platform Software



Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.

Thread closed continue here:
https://www.unix.com/unix-for-beginners-questions-and-answers/283647-awk-script.html\#post303043389