i tried to a filename header like this
awk -F= -vOFS="," '
> NR == 1 {HD = "FILENAME=IP address=PC name=destination=UTC begin=UTC end=destination IP address=duration (ms)=local begin=local end=" \
> "source IP address=actual extension=original called party=original calling party"
> for (N=i=split (HD, T); i>0; i--) SRCH[T]
> for (i=1; i<N; i++) printf "%s%s", T, OFS
> print T[N]
> FN = FILENAME
> }
> FNR==1 && L {printf "%s%s", FN, OFS
> for (i=1; i<N; i++) printf "%s%s", PR[T], OFS
> print PR[T[N]]
> FN = FILENAME
> delete PR
> }
>
> $1 in SRCH {PR[$1]=$NF
> L=1
> }
> END {printf "%s%s", FN, OFS
> for (i=1; i<N; i++) printf FILENAME "%s%s", PR[T], OFS
> print PR[T[N]]
> }
> ' *
and get this
FILENAME,IP address,PC name,destination,UTC begin,UTC end,destination IP address,duration (ms),local begin,local end,source IP address,actual extension,original called party,original calling party
20090130T165309.474091.ipfx_audio,,10.11.40.61,D01309,,20090130T165309.474090,20090130T170003.303469,10.11.41.151,413829,20090130T165309.474091,20090130T170003.303469,10.11.0.241,,,
20090130T165558.886637.ipfx_audio,,10.11.40.67,D01332,,20090130T165558.886637,20090130T165839.247671,10.11.41.136,160361,20090130T165558.886637,20090130T165839.247671,10.11.0.240,,,
20090130T170010.074146.ipfx_audio,,10.11.40.61,D01309,,20090130T170010.074146,20090130T170019.325071,10.11.41.151,9250,20090130T170010.074146,20090130T170019.325071,10.11.41.97,,,
but i shouldn't get a ,, between 20090130T165309.474091.ipfx_audio and 10.11.40.61
where do i need to remove it?
thanks