Parsing a file that contains 2 types of delimeters

I am trying to write a script and failing miserably. I have a file that looks something like this;

20050924-155819;Backoffice;1037;0;DDT-TCP/IP;;0;Node
20050924-155902;Unknown;1036;0;DDT-TCP/IP;;0;Node
20050924-155922;FrontOffice;1040;5;DDT-

The desired result is one file containing only the date and username (ie; Backoffice) but I can't seem to get around parsing out the numbers afters the date (delimited by -) and the username delimeited by ;

I tried cut and awk and I either get only the date or only the username and now I reallly need help.

Thanks.

Morgado,
See if this works for you:

cut -d';' -f1,2 input_file | sed 's/-.*;/ /' > output_file

awk works as well

awk -F'-;'  '{ print $1, $3 }' oldfile > newfile

That's awesome!! It works.

Thanks so much for your help :smiley:

Thanks for your reply. Yes that worked too!! I will keep note of these commands for future use. :o