BEGIN {
    state = 0;
}

{
    if (substr ($0, 1, 5) == "*SRC=")
    {
        state = 1;
        Vpk   = $2;
        Iave  = $3;
        Tt    = $4;
        mfg   = "DiodesInc";
        type  = "silicon";
        if ($1 ~ /Schottky/)
            type = "Schottky";
        print $0;
    }
    else if (state == 1 && $(NF) == ")")
    {
        $(NF) = " Vpk=" Vpk " Iave=" Iave " Tt=" Tt " mfg=DiodesInc type=" type " )";
#        printf ("ha!\n");
        for (i = 1; i < NF-1; ++i)
        {
            if (i != 1)
                printf (" ");
            printf ("%s", $(i));
        }
        printf (" mfg=%s )\n", mfg);
        state = 0;
    }
    else
    {
#        printf ("state = %d, $(NF) == '%s'\n", state, $(NF));
        print $0;
    }
}

