how do u creat a text file
You mean a config file? You create a text file and place commands within it like the following.
unbindall
bind "RIGHTCTRL" "_attack"
bind "RIGHTSHIFT" "_speed"
bind "TAB" "_impulse19"
bind "ESCAPE" "togglemenu"
bind "SPACE" "_moveup"
bind "0" "_impulse9"
bind "1" "_impulse0"
bind "2" "_impulse1"
bind "3" "_impulse2"
bind "4" "_impulse3"
bind "8" "_impulse7"
bind "9" "_impulse8"
bind "[" "_impulse14"
bind "]" "_impulse15"
bind "`" "toggleconsole"
bind "a" "_moveleft"
bind "c" "_moveDown"
bind "d" "_moveright"
bind "e" "_impulse6"
bind "f" "_impulse8"
bind "p" "god"
bind "q" "_impulse3"
bind "r" "_impulse7"
bind "s" "_back"
bind "t" "clientmessagemode"
bind "w" "_forward"
bind "y" "clientmessagemode 1"
bind "z" "_ingameStats"
bind "~" "toggleconsole"
bind "PAUSE" "pause"
bind "UPARROW" "_forward"
set g_fov 125
set com_showfps 1
ETC.

.
This was taking from the default quake 4 config which you can find in your C:\Program Files\id Software\Quake 4\q4base. I added the fov and fps commands at the bottom to show you example of other commands rather then just simple bind commands.
After you create it in text file format click on File, Save as, and in the "file name" text field use "autoexec.cfg" With the quotes! This will save it as a .cfg file and the name "autoexec" will make sure that it is run each and every time you run Quake 4. It then must be placed in the q4base directory. You can google for console commands. As time passes the lists will become much longer I'm sure but as Quake 4 is still fairly new there is less info. I usually in my configs save all settings, ones that can be found in via Menus as well as the ones which cannot be. This is handy for when you reformat your PC, If you save it you can get your game back up and running much faster this way.
Edit:
A hell a little further explanation on use of CFG's... You can give the .cfg file whatever name you like. This makes it real handy to switch multiple settings quickly depending on the situation. To activate a .cfg file in game you would in console type. exec "name".cfg... "name" being the name which you called your config without the quotes.
Also for a much better situation you can bind keys to execute different configs. You would do this like so... Assume you have 3 configs with the following names... fast.cfg, medium.cfg, slow.cfg... You can bind them like so. In console type (or better yet in an autoexec.cfg put the bind commands.
bind p exec fast.cfg
bind o exec medium.cfg
bind i exec slow.cfg
You can have allot of fun with configs and have a fast and powerful method of switching multiple settings on the fly.