RFID cards issue with comparing cards

Hi, I need help.
I have an ID-20 reader connected to an arduino (all working).
It's outputing this when I use a card :

310022FDA94 .
I've tried with different cards and all cards output in the same format.

This is the code I'm using :

/* RFID ID12
*/

char val = 0; // variable to store the data from the serial port

void setup() {
Serial.begin(9600); // connect to the serial port
}

void loop () {
// read the serial port

if(Serial.available() > 0) {
val = Serial.read();
Serial.print(val, BYTE);

}
}

I want the program to print to Serial : "card1" if the card
output is :310022FDA94 ( my card1 ).
How would I go on about distinguishing them?

Thanks in advance.
Sincerely

Paul

You need to collect the data read from the tag into an array, one character at a time. When the end-of-packet marker is read, you can use strcmp() to compare the actual value read to a specific value.

Do some searching of the forum. There are examples for every kind of RFID reader available.