UNIX file handling issue

view story

http://www.unix.com – I have a huge file semicolon( ; ) separated records are Pipe(|) delimited. e.g Code: abc;def;ghi|jkl;mno;pqr|123;456;789 I need to replace the 50th field(semicolon separated) of each record with 9006. The 50th field can have no value e.g. ;; Can someone help me with the appropriate command. (HowTos)