To find char field and replace null

hi,

i having a file with | seperated in which i need to search char in 3rd column and replace with null. i need to replace only the coulmn where character occurs in 3rd field

for eg:

file1.txt
xx|yy|xx|12

output file:
xx|yy||12
$ awk 'BEGIN {FS=OFS="|" } $3 ~ /xx/ { $3="" }1' file
aa|bb||dd

hi how we can check for number series i mean alphanuperic

awk 'BEGIN {FS=OFS="|" } $112 ~ /^[A-Za-z][A-Za-z][0-9]*$/ { $112="" }1'

above one is not working

$ cat file
aa|bb|xx|dd
aa|bb|!!|dd
$ awk 'BEGIN {FS=OFS="|" } $3 ~ /[[:alnum:]]/ { $3="" }1' file
aa|bb||dd
aa|bb|!!|dd
$ 

Use ^ and $ if required.

Or

/^[[:alnum:]]+$/
/^[[:alpha:]][[:alnum:]]+$/

Yeah the above one worked is it possible to replace with exact null value instead of space becoz my output file is being replaced with space I tried placing with null instead of "" then also same problem
Y u need is becoz I will be using the above output file for loading in temp table using SQL loader wherein the 3rd Column of my temp table accepts only number not char. In this case some records are loading fine some are going to bad file, when checked the bad file it shows no data but with space records

---------- Post updated at 12:21 PM ---------- Previous update was at 11:07 AM ----------

Guys got any clue..??????