Rabu, 25 Februari 2015

Re: [MS_AccessPros] Convert comma delimiter to cedilla delimiter

 

WARNING:  The below code will replace ALL commas in the input, even those embedded in quoted strings.


If you have embedded commas, you'll have to examine the string character by character.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Feb 25, 2015, at 9:15 PM, John Viescas JohnV@msn.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Mike-

You mean a:

ç

??

You could use Open to open the text file in VBA and read a record at a time into a string variable.  Use the Replace function to swap out , for ç, then write the string to an output file.

Dim strText As String

     Open "C:\MyFiles\CommaDelim.txt" For Input Access Read As #1
     Open "C:\MyFiles\CedillaDelim.txt" For Output Access Write As #2
     Do While Not EOF(1)
         Line Input #1, strText
         strText = Replace(strText, ",", "ç")
         Print #2, strText
     Loop
     Close #1
     Close #2


John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Feb 25, 2015, at 8:26 PM, mithomas48 <no_reply@yahoogroups.com> wrote:

Liz, you're speaking Greek to me!  LOL

 

Our text file is comma delimited and we just need to replace those commas with the cedilla symbol.  Hope that makes sense.

 

Thanks again!

Mike



__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (8)

.

__,_._,___

Tidak ada komentar:

Posting Komentar