i m full in networking i work so much with CISCO and Juniper so i m new doing automation with Linux i try first to get all the information now i would like some help to manipulate the information with shell script
for the VLAN 3 we have like 4057 VLANS that mean ( 4057 Line ) so the same for as VLAN 1 and VLAN 2 VLAN 3 ..... VLAN 4057
I'm sure you can do what you want in awk. But I don't understand precisely what you want since file-1 doesn't appear to contribute anything to your output.
i put in File-1 all the numbers of all the ports in switch ( some switch have different numbers ( example switch-1 have 1/1 ,1/2 ,1/3 ,....... 6/7
and switch-2 have 1/1/1,1/1/2,1/1/3 ............,2/2/17) so this all port numbers i will put them in table
awk -F"," -v OFS="|" 'NR==FNR { C[$1] ; next } # Save list of ports
{
ID[$1] # Save list of IDs
D[$1,"NAME"]=$2
for(N=3; N<=NF; N++) D[$1,$N]
}
END { for(X in ID) # Print everything
{
$0=""; $1=X ; $2=D[X,"NAME"];
L=3;
for(V in C)
{
if ((X,V) in D) $L="*";
L++
}
print;
}
}' file-1 file-2