Just saying vaguely that "it isn't working" isn't a very productive way to ask for help.
You should at the very least explain
exactly what you are trying to do and the
exact output you want, posting real-to-life examples where possible.
Then you should also post some of the commands you've tried already and the results you got. How can we tell you where you're going wrong if we can't see what you did?
onebuck's signature includes a link to "How to Ask Questions the Smart Way". I recommend checking it out.