<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Why does WriteLine() add quotes to the string it is writing (to file) - VBA.Net in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-writeline-add-quotes-to-the-string-it-is/m-p/337590#M8846</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm on Arcgis10 with VS2008Express with VBA.Net.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a parser setup to read a csv file. However when I write the file using code (WRiteLine() ) the parser can no longer read it as separate 'parts'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My issue: WriteLine() insists on putting quotes around each string, so what the parser could read as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;aField, aValue&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;has now turned into &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"aField, aValue"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My parser can no longer read it (aParsedString.First and .Last both return the entire string between the quotes. I cannot add " as a delimeter as the code won't accept 'aDelim = """ '&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas how I can either fix the parser or get WriteLine to write the string without the quotes? I tried PrintLine based on a suggestion from another post but that writes with quotes, and NOT to individual lines - seemed weird, considering PrintLINE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Nov 2010 18:56:39 GMT</pubDate>
    <dc:creator>TomGiles</dc:creator>
    <dc:date>2010-11-25T18:56:39Z</dc:date>
    <item>
      <title>Why does WriteLine() add quotes to the string it is writing (to file) - VBA.Net</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-writeline-add-quotes-to-the-string-it-is/m-p/337590#M8846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm on Arcgis10 with VS2008Express with VBA.Net.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a parser setup to read a csv file. However when I write the file using code (WRiteLine() ) the parser can no longer read it as separate 'parts'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My issue: WriteLine() insists on putting quotes around each string, so what the parser could read as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;aField, aValue&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;has now turned into &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"aField, aValue"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My parser can no longer read it (aParsedString.First and .Last both return the entire string between the quotes. I cannot add " as a delimeter as the code won't accept 'aDelim = """ '&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas how I can either fix the parser or get WriteLine to write the string without the quotes? I tried PrintLine based on a suggestion from another post but that writes with quotes, and NOT to individual lines - seemed weird, considering PrintLINE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 18:56:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-writeline-add-quotes-to-the-string-it-is/m-p/337590#M8846</guid>
      <dc:creator>TomGiles</dc:creator>
      <dc:date>2010-11-25T18:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why does WriteLine() add quotes to the string it is writing (to file) - VBA.Net</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-writeline-add-quotes-to-the-string-it-is/m-p/337591#M8847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you post the code you have?&amp;nbsp; Are you getting the values from an attribute table?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I recommend you use a Streamwriter.writeline to write to a file.&amp;nbsp; A lot better than the method you're using. Google Stream.writer for VB.NET and you'll get a lot of help.&amp;nbsp; Also, make sure you use VB.NET in google.&amp;nbsp; There's no such thing as VBA.NET.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 19:04:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-writeline-add-quotes-to-the-string-it-is/m-p/337591#M8847</guid>
      <dc:creator>RuchiraWelikala</dc:creator>
      <dc:date>2010-11-25T19:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why does WriteLine() add quotes to the string it is writing (to file) - VBA.Net</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-writeline-add-quotes-to-the-string-it-is/m-p/337592#M8848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your suggestion - I will look at Stream.Writeline. And... Definitely vb.net &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code I have reads from csv file using a parser:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim filename As String = "c:\log.txt"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim fields As String()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim delimiter As String = ","&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using parser As New textFileParser(filename)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; parser.SetDelimiter(delimiter)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; While Not parser.EndOfData&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fields = parser.Readfields()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'this parser works using fields.First and fields.Last to read in the two parts (the log.txt file is just 'aField, aValue) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'however this only works when the log.txt file starts with no quotes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'To Write, I use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim aFile as Long&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim aFileName as String&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;aFileName = "c:\log.txt"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FileOpen(aFile, aFileName, OpenMode.Output ... and defaults...)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Writeline(aFile, StringToWrite)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FileClose(aFile)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'end code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I actually got around the issue by going through what the parser was returning char by char looking for the comma - but that is the parser's job in the first place!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I really want to clean it up...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for your help.&amp;nbsp; Going to look at stream.writeline right now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers mate!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 19:21:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-writeline-add-quotes-to-the-string-it-is/m-p/337592#M8848</guid>
      <dc:creator>TomGiles</dc:creator>
      <dc:date>2010-11-25T19:21:38Z</dc:date>
    </item>
  </channel>
</rss>

