Hi
I'm using this to get the destinct numbers in a list. this is a list from a logfile that I have to use in a SQL, so I have to put a , after every entery except the last one.
cat logfil.log|awk -F ";" '{print $1}'|grep -v QA |grep -v BAN|awk -F- '{++a[$1]}END{for(i in a)print i,a}'|awk '{print $1}'
It is easy to put it after every item '{print $1 ","}'
But I can't have it after the last one or the SQL will not work.
Does anyboddy have any ideers?
/Lhg
I'm using this to get the destinct numbers in a list. this is a list from a logfile that I have to use in a SQL, so I have to put a , after every entery except the last one.
cat logfil.log|awk -F ";" '{print $1}'|grep -v QA |grep -v BAN|awk -F- '{++a[$1]}END{for(i in a)print i,a}'|awk '{print $1}'
It is easy to put it after every item '{print $1 ","}'
But I can't have it after the last one or the SQL will not work.
Does anyboddy have any ideers?
/Lhg