How to read only 1st three character from a file using sed in unix

Hi
can any one please help me how to read forst three character from a file using sed or any other way

example

My file contains data like this

asd123#412

I want to just read 1st three characters no matter whatever it is (character, digit, special characters, space, tab..etc)

Thanks in advance

[house@leonov] FULL='asd123#412' ; PART=${FULL:0:3} ; echo $PART
asd
sed 's/\(.\{3\}\).*/\1/' file

Why can you not use cut?

cut -c1-3  filename

Sounds like homework to me.....

Few more:

awk '{print substr($0,1,3)}' file

perl -lne '/(.{3}).*/ and print $1' file

perl -lne '/(...).*/ and print $1' file

perl -lne 'print substr($_,0,3)' file

perl -lne '@x=unpack("A3"); print $x[0]' file

tyler_durden

Thank u very much,

Can u pls throw some light over it.

Taking this task literally, any program which knows about records is not suitable. We need to read the raw file.

My solution to getting the first three characters of a file no matter what they are is:

dd bs=3 count=1 if=input_file of=output_file

We have avoided putting the characters in a shell variable because we don't know what they are.
Program "cut" is unsuitable if one of the characters is a linefeed for example.