在VF或SQL中,我要将某列数据中的[]里的东西全部替换为某一固定的字或字母或空格
[Eilertsen,EinarA.;Ogino,Isao;Zones,StaceyI.;Katz,Alexander]UnivCalifBerkeley,DeptChe...
[Eilertsen, Einar A.; Ogino, Isao; Zones, Stacey I.; Katz, Alexander] Univ Calif Berkeley, Dept Chem & Biomol Engn, Berkeley, CA 94720 USA; [Rea, Thomas; Yeh, Sheila; Zones, Stacey I.] Chevron Energy Technol Co, Richmond, CA 94804 USA; [Hwang, Son-Jong] ,CA 94804 USA,这段里面有三组[],这堆数据在sheet1表中的C1字段的第一条记录里,表很大,一共有1万多条记录,请问如何批量的将中括号里的数据替换成空格。谢谢
展开
展开全部
** 注意原字符串中的[]必须成对出现,否则出错,
SET ESCAPE ON
CLEAR
c_string ="[Eilertsen, Einar A.; Ogino, Isao; Zones, Stacey I.; Katz, Alexander] Univ Calif Berkeley, Dept Chem & Biomol Engn, Berkeley, CA 94720 USA; [Rea, Thomas; Yeh, Sheila; Zones,"
c_String =c_string+" Stacey I.] Chevron Energy Technol Co, Richmond, CA 94804 USA; [Hwang, Son-Jong] ,CA 94804 USA,"
LOCAL n_start , n_end , c_replace
n_start =0
n_end =0
c_replace =""
?"原字符串是:"+c_string
DO WHILE "["$c_string
n_Start =AT("[",c_String)
n_end =AT("]",c_string)
c_string =STUFF(c_string,n_start,n_end-n_start+1,c_replace)
ENDDO
?"结果是:"+c_string
SET ESCAPE ON
CLEAR
c_string ="[Eilertsen, Einar A.; Ogino, Isao; Zones, Stacey I.; Katz, Alexander] Univ Calif Berkeley, Dept Chem & Biomol Engn, Berkeley, CA 94720 USA; [Rea, Thomas; Yeh, Sheila; Zones,"
c_String =c_string+" Stacey I.] Chevron Energy Technol Co, Richmond, CA 94804 USA; [Hwang, Son-Jong] ,CA 94804 USA,"
LOCAL n_start , n_end , c_replace
n_start =0
n_end =0
c_replace =""
?"原字符串是:"+c_string
DO WHILE "["$c_string
n_Start =AT("[",c_String)
n_end =AT("]",c_string)
c_string =STUFF(c_string,n_start,n_end-n_start+1,c_replace)
ENDDO
?"结果是:"+c_string
2012-06-03
展开全部
sql中有个函数replace
追问
能把详细的语句写出来吗?我知道replace这个函数,但后面的条件怎么写呢,替换语句怎么写
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询