oRE = CREATEOBJECT("VBScript.RegExp") >* lcfile is the CSV file >lcstring = FILETOSTR(lcfile) >* Remove the / >oRE.Pattern = "(\d+)\/(\d+)\/(\d+)" >oRE.Global = .T. >lcstring = oRE.Replace(lcstring, "$1$2$3") >oRE.Pattern = "(\d+)\-(\d+)\-(\d+)" >lcstring = oRE.Replace(lcstring, "$1$2$3")and save the string back using STRTOFILE().
lcstring = FILETOSTR(lcfile) * try lcstring = '2001/02/29,01/02/09,01-02-09,001-1-09,A01-02-09,01-02-09' * as some test examples * Remove the /, within word boundaries if it's really a CSV oRE.Pattern = "\b(\d{4})/(\d{2})/(\d{2})\b" && / is not escaped oRE.Global = .T. lcstring = oRE.Replace(lcstring, "$1$2$3") * Remove the -, within word boundaries if it's really a CSV oRE.Pattern = "\b(\d{2})\-(\d{2})\-(\d{2})\b" lcstring = oRE.Replace(lcstring, "$1$2$3")