<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Daily Dose of Excel</title>
	<atom:link href="http://dailydoseofexcel.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://dailydoseofexcel.com</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Wed, 15 May 2013 18:27:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>Comment on Importing Fixed Width Text Files with ActiveX Data Objects by Dick Kusleika</title>
		<link>http://dailydoseofexcel.com/archives/2013/05/10/importing-fixed-width-text-files-with-activex-data-objects/#comment-92102</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Wed, 15 May 2013 18:27:05 +0000</pubDate>
		<guid isPermaLink="false">http://dailydoseofexcel.com/?p=7918#comment-92102</guid>
		<description><![CDATA[No it was local. It was a few thousand pages.]]></description>
		<content:encoded><![CDATA[<p>No it was local. It was a few thousand pages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Importing Fixed Width Text Files with ActiveX Data Objects by Nigel Heffernan</title>
		<link>http://dailydoseofexcel.com/archives/2013/05/10/importing-fixed-width-text-files-with-activex-data-objects/#comment-92100</link>
		<dc:creator>Nigel Heffernan</dc:creator>
		<pubDate>Wed, 15 May 2013 12:03:44 +0000</pubDate>
		<guid isPermaLink="false">http://dailydoseofexcel.com/?p=7918#comment-92100</guid>
		<description><![CDATA[You may find that you can only read files with a .txt and .csv extension using the Jet 4.0 driver: by default, other file extensions are disabled, no matter what you specify in the Schema.

Here&#039;s what to do if you&#039;re trying to read a file with a .log extension and you prefer not to rename it:

&lt;CODE Lang=&quot;vb&quot;&gt;

&#039; Can this workstation read .log files using the SQL text driver?
&#039; An explanation of this procedure is available here:
&#039;   http://msdn.microsoft.com/en-us/library/ms974559.aspx

Dim strFileKey  As String
Dim strExt      As String
Dim objShell    As Object                            &#039; As IWshRuntimeLibrary.WshShell                           &#039;
Set objShell = CreateObject(&quot;WScript.Shell&quot;)         &#039; New IWshRuntimeLibrary.WshShell
&#039;
If objShell Is Nothing Then
    Shell &quot;Regsvr32.exe /s wshom.ocx&quot;, vbHide
    Set objShell = CreateObject(&quot;WScript.Shell&quot;)
End If

If Not objShell Is Nothing Then
    strFileKey = objShell.RegRead(&quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Text\DisabledExtensions&quot;)
    If strFileKey &lt;&gt; &quot;&quot; Then
    
        strExt = &quot;log&quot;

        If InStr(1, strFileKey, strExt, vbTextCompare) &lt; 1 Then
            objShell.RegWrite _ 
            &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Text\DisabledExtensions&quot;, _ 
            strFileKey &amp; &quot;,&quot; &amp; strExt, _ 
            &quot;REG_SZ&quot;
        End If
    
    End If

End If

&lt;/CODE&gt;



Alternatively, could specify the ODBC text driver in the connection string for your ADO connection:

&lt;CODE Lang=&quot;vb&quot;&gt;
&#039;
strConn = &quot;&quot;
strConn = strConn &amp; &quot;Driver={Microsoft Text Driver (*.txt; *.csv)};&quot;
strConn = strConn &amp; &quot;Extensions=asc,csv,tab,txt,log,dat;&quot;
strConn = strConn &amp; &quot;Dbq=&quot; &amp; strFolder &amp; &quot;;&quot; 
strConn = strConn &amp; &quot;Extended Properties=&quot; &amp; Chr(34) &amp; &quot;text;HDR=NO;IMEX=2;MAXSCANROWS=0;&quot; &amp; Chr(34) &amp; &quot;;&quot;
&#039;
&lt;/CODE&gt;



Also: ninety seconds?

Were you reading this across the network? It&#039;s always faster to use the file system to copy the file across to a local folder and read in the file from there, even when using ADODB.]]></description>
		<content:encoded><![CDATA[<p>You may find that you can only read files with a .txt and .csv extension using the Jet 4.0 driver: by default, other file extensions are disabled, no matter what you specify in the Schema.</p>
<p>Here&#8217;s what to do if you&#8217;re trying to read a file with a .log extension and you prefer not to rename it:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">' Can this workstation read .log files using the SQL text driver?<br />
' An explanation of this procedure is available here:<br />
' &nbsp; http://msdn.microsoft.com/en-us/library/ms974559.aspx<br />
<br />
Dim strFileKey &nbsp;As String<br />
Dim strExt &nbsp; &nbsp; &nbsp;As String<br />
Dim objShell &nbsp; &nbsp;As Object &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;' As IWshRuntimeLibrary.WshShell &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '<br />
Set objShell = CreateObject(&quot;WScript.Shell&quot;) &nbsp; &nbsp; &nbsp; &nbsp; ' New IWshRuntimeLibrary.WshShell<br />
'<br />
If objShell Is Nothing Then<br />
&nbsp; &nbsp; Shell &quot;Regsvr32.exe /s wshom.ocx&quot;, vbHide<br />
&nbsp; &nbsp; Set objShell = CreateObject(&quot;WScript.Shell&quot;)<br />
End If<br />
<br />
If Not objShell Is Nothing Then<br />
&nbsp; &nbsp; strFileKey = objShell.RegRead(&quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Text\DisabledExtensions&quot;)<br />
&nbsp; &nbsp; If strFileKey &lt;&gt; &quot;&quot; Then<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; strExt = &quot;log&quot;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; If InStr(1, strFileKey, strExt, vbTextCompare) &lt; 1 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objShell.RegWrite _ <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Text\DisabledExtensions&quot;, _ <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strFileKey &amp; &quot;,&quot; &amp; strExt, _ <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;REG_SZ&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; End If<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; End If<br />
<br />
End If</div></div>
<p>Alternatively, could specify the ODBC text driver in the connection string for your ADO connection:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">'<br />
strConn = &quot;&quot;<br />
strConn = strConn &amp; &quot;Driver={Microsoft Text Driver (*.txt; *.csv)};&quot;<br />
strConn = strConn &amp; &quot;Extensions=asc,csv,tab,txt,log,dat;&quot;<br />
strConn = strConn &amp; &quot;Dbq=&quot; &amp; strFolder &amp; &quot;;&quot; <br />
strConn = strConn &amp; &quot;Extended Properties=&quot; &amp; Chr(34) &amp; &quot;text;HDR=NO;IMEX=2;MAXSCANROWS=0;&quot; &amp; Chr(34) &amp; &quot;;&quot;<br />
'</div></div>
<p>Also: ninety seconds?</p>
<p>Were you reading this across the network? It&#8217;s always faster to use the file system to copy the file across to a local folder and read in the file from there, even when using ADODB.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Importing Fixed Width Text Files with ActiveX Data Objects by Nigel Heffernan</title>
		<link>http://dailydoseofexcel.com/archives/2013/05/10/importing-fixed-width-text-files-with-activex-data-objects/#comment-92099</link>
		<dc:creator>Nigel Heffernan</dc:creator>
		<pubDate>Wed, 15 May 2013 10:16:15 +0000</pubDate>
		<guid isPermaLink="false">http://dailydoseofexcel.com/?p=7918#comment-92099</guid>
		<description><![CDATA[Odd. I thought everyone was using ADO to read text files with SQL.


Meanwhile, a quick tip: the ADODB.Recordset has a save method, which writes to an XML file or to a tab-delimited text file. This is not, of itself, terribly interesting: but the flipside of that is that the ADODB.Recordset object has a native &#039;Open&#039; method that loads from a file:

Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
    rst.Open &quot;C:\Temp\SysLog.txt&quot;

    rst.Filter = &quot;[msgType]=&#039;ERROR&#039;&quot;

If the file&#039;s tab-delimited, that&#039;s it. All of it. Not quite what you want for fixed-width files, but kinda useful.]]></description>
		<content:encoded><![CDATA[<p>Odd. I thought everyone was using ADO to read text files with SQL.</p>
<p>Meanwhile, a quick tip: the ADODB.Recordset has a save method, which writes to an XML file or to a tab-delimited text file. This is not, of itself, terribly interesting: but the flipside of that is that the ADODB.Recordset object has a native &#8216;Open&#8217; method that loads from a file:</p>
<p>Dim rst As ADODB.Recordset<br />
Set rst = New ADODB.Recordset<br />
    rst.Open &#8220;C:\Temp\SysLog.txt&#8221;</p>
<p>    rst.Filter = &#8220;[msgType]=&#8217;ERROR&#8217;&#8221;</p>
<p>If the file&#8217;s tab-delimited, that&#8217;s it. All of it. Not quite what you want for fixed-width files, but kinda useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Importing Fixed Width Text Files with ActiveX Data Objects by snb</title>
		<link>http://dailydoseofexcel.com/archives/2013/05/10/importing-fixed-width-text-files-with-activex-data-objects/#comment-92086</link>
		<dc:creator>snb</dc:creator>
		<pubDate>Tue, 14 May 2013 19:53:52 +0000</pubDate>
		<guid isPermaLink="false">http://dailydoseofexcel.com/?p=7918#comment-92086</guid>
		<description><![CDATA[But if you insist on using ADODB and a schema.ini file:

&lt;code lang=&quot;vb&quot;&gt;Sub M_snb_007()
  c00 = &quot;G:\OF\&quot;
  c01 = c00 &amp; &quot;0_fixedwidth_example_001.txt&quot;
  c02 = &quot;0_fixedwidth_example_002.txt&quot;
  c03 = c00 &amp; &quot;schema.ini&quot;
    
  With CreateObject(&quot;scripting.filesystemobject&quot;)
    sn = Filter(Filter(Split(Replace(.opentextfile(c01).readall, &quot;,&quot;, &quot;&quot;), vbCrLf), Space(60), False), &quot;/&quot;)
    .createtextfile(c00 &amp; c02).write sn(0) &amp; vbCrLf &amp; Join(sn, vbCrLf)
        
    y = InStr(sn(0), &quot; &quot;)
    For j = 1 To Len(sn(0))
      For jj = 1 To UBound(sn)
        If Mid(sn(jj), y, 1) &lt;&gt; &quot; &quot; Then Exit For
      Next
      If jj = UBound(sn) + 1 Then c04 = c04 &amp; Mid(sn(0), Len(c04) + 1, y - Len(c04) - 1) &amp; &quot;&#124;&quot;
      y = y + InStr(Mid(sn(0), y + 1), &quot; &quot;)
      If y = Len(sn(0)) Then Exit For
    Next
    c04 = c04 &amp; Right(sn(0), y - Len(c03))
        
    For j = UBound(Split(c04, &quot;&#124;&quot;)) To 2 Step -1
      c04 = Replace(c04, String(j, &quot;&#124;&quot;), &quot;&#124;&quot; &amp; Space(j - 1))
    Next
    sp = Split(c04, &quot;&#124;&quot;)
        
    For j = 0 To UBound(sp)
      sp(j) = &quot;Col&quot; &amp; j + 1 &amp; &quot;=veld&quot; &amp; j + 1 &amp; &quot; Text Width &quot; &amp; Len(sp(j)) + 1
    Next
    .createtextfile(c03).write &quot;[&quot; &amp; c02 &amp; &quot;]&quot; &amp; vbCrLf &amp; &quot;Format=Fixedlength&quot; &amp; String(2, vbCrLf) &amp; Join(sp, vbCrLf)
  End With
    
  With New ADODB.Recordset
    .Open &quot;SELECT * FROM &quot; &amp; c02, &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; &amp; c00 &amp; &quot;;Extended Properties=&quot;&quot;text;HDR=yes;FMT=FixedLength&quot;&quot;&quot;, 3, 3, 1
    Cells(1).CopyFromRecordset .DataSource
  End With
End Sub&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>But if you insist on using ADODB and a schema.ini file:</p>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #E56717; font-weight: bold;">Sub</span> M_snb_007()<br />
&nbsp; c00 = <span style="color: #800000;">&quot;G:\OF\&quot;</span><br />
&nbsp; c01 = c00 &amp; <span style="color: #800000;">&quot;0_fixedwidth_example_001.txt&quot;</span><br />
&nbsp; c02 = <span style="color: #800000;">&quot;0_fixedwidth_example_002.txt&quot;</span><br />
&nbsp; c03 = c00 &amp; <span style="color: #800000;">&quot;schema.ini&quot;</span><br />
&nbsp; &nbsp; <br />
&nbsp; <span style="color: #8D38C9; font-weight: bold;">With</span> <span style="color: #E56717; font-weight: bold;">CreateObject</span>(<span style="color: #800000;">&quot;scripting.filesystemobject&quot;</span>)<br />
&nbsp; &nbsp; sn = Filter(Filter(Split(Replace(.opentextfile(c01).readall, <span style="color: #800000;">&quot;,&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>), vbCrLf), Space(60), <span style="color: #00C2FF; font-weight: bold;">False</span>), <span style="color: #800000;">&quot;/&quot;</span>)<br />
&nbsp; &nbsp; .createtextfile(c00 &amp; c02).write sn(0) &amp; vbCrLf &amp; Join(sn, vbCrLf)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; y = InStr(sn(0), <span style="color: #800000;">&quot; &quot;</span>)<br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> j = 1 <span style="color: #8D38C9; font-weight: bold;">To</span> Len(sn(0))<br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> jj = 1 <span style="color: #8D38C9; font-weight: bold;">To</span> <span style="color: #151B8D; font-weight: bold;">UBound</span>(sn)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">If</span> Mid(sn(jj), y, 1) &lt;&gt; <span style="color: #800000;">&quot; &quot;</span> <span style="color: #8D38C9; font-weight: bold;">Then</span> <span style="color: #E56717; font-weight: bold;">Exit</span> <span style="color: #8D38C9; font-weight: bold;">For</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">If</span> jj = <span style="color: #151B8D; font-weight: bold;">UBound</span>(sn) + 1 <span style="color: #8D38C9; font-weight: bold;">Then</span> c04 = c04 &amp; Mid(sn(0), Len(c04) + 1, y - Len(c04) - 1) &amp; <span style="color: #800000;">&quot;|&quot;</span><br />
&nbsp; &nbsp; &nbsp; y = y + InStr(Mid(sn(0), y + 1), <span style="color: #800000;">&quot; &quot;</span>)<br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">If</span> y = Len(sn(0)) <span style="color: #8D38C9; font-weight: bold;">Then</span> <span style="color: #E56717; font-weight: bold;">Exit</span> <span style="color: #8D38C9; font-weight: bold;">For</span><br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; &nbsp; c04 = c04 &amp; Right(sn(0), y - Len(c03))<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> j = <span style="color: #151B8D; font-weight: bold;">UBound</span>(Split(c04, <span style="color: #800000;">&quot;|&quot;</span>)) <span style="color: #8D38C9; font-weight: bold;">To</span> 2 <span style="color: #8D38C9; font-weight: bold;">Step</span> -1<br />
&nbsp; &nbsp; &nbsp; c04 = Replace(c04, <span style="color: #F660AB; font-weight: bold;">String</span>(j, <span style="color: #800000;">&quot;|&quot;</span>), <span style="color: #800000;">&quot;|&quot;</span> &amp; Space(j - 1))<br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; &nbsp; sp = Split(c04, <span style="color: #800000;">&quot;|&quot;</span>)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> j = 0 <span style="color: #8D38C9; font-weight: bold;">To</span> <span style="color: #151B8D; font-weight: bold;">UBound</span>(sp)<br />
&nbsp; &nbsp; &nbsp; sp(j) = <span style="color: #800000;">&quot;Col&quot;</span> &amp; j + 1 &amp; <span style="color: #800000;">&quot;=veld&quot;</span> &amp; j + 1 &amp; <span style="color: #800000;">&quot; Text Width &quot;</span> &amp; Len(sp(j)) + 1<br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; &nbsp; .createtextfile(c03).write <span style="color: #800000;">&quot;[&quot;</span> &amp; c02 &amp; <span style="color: #800000;">&quot;]&quot;</span> &amp; vbCrLf &amp; <span style="color: #800000;">&quot;Format=Fixedlength&quot;</span> &amp; <span style="color: #F660AB; font-weight: bold;">String</span>(2, vbCrLf) &amp; Join(sp, vbCrLf)<br />
&nbsp; <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">With</span><br />
&nbsp; &nbsp; <br />
&nbsp; <span style="color: #8D38C9; font-weight: bold;">With</span> <span style="color: #E56717; font-weight: bold;">New</span> ADODB.Recordset<br />
&nbsp; &nbsp; .<span style="color: #151B8D; font-weight: bold;">Open</span> <span style="color: #800000;">&quot;SELECT * FROM &quot;</span> &amp; c02, <span style="color: #800000;">&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot;</span> &amp; c00 &amp; <span style="color: #800000;">&quot;;Extended Properties=&quot;</span><span style="color: #800000;">&quot;text;HDR=yes;FMT=FixedLength&quot;</span><span style="color: #800000;">&quot;&quot;</span>, 3, 3, 1<br />
&nbsp; &nbsp; Cells(1).CopyFromRecordset .DataSource<br />
&nbsp; <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">With</span><br />
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Sub</span></div></div>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Importing Fixed Width Text Files with ActiveX Data Objects by snb</title>
		<link>http://dailydoseofexcel.com/archives/2013/05/10/importing-fixed-width-text-files-with-activex-data-objects/#comment-92052</link>
		<dc:creator>snb</dc:creator>
		<pubDate>Mon, 13 May 2013 17:10:24 +0000</pubDate>
		<guid isPermaLink="false">http://dailydoseofexcel.com/?p=7918#comment-92052</guid>
		<description><![CDATA[No harm done, just a slight amendment:

&lt;code lang=&quot;vb&quot;&gt;Sub M_snb()
    sn = Filter(Filter(Split(Replace(CreateObject(&quot;scripting.filesystemobject&quot;).opentextfile(&quot;G:\OF\0_fixedwidth_example_001.txt&quot;).readall, &quot;,&quot;, &quot;&quot;), vbCrLf), Space(60), False), &quot;/&quot;)
    
    y = InStr(sn(0), &quot; &quot;)
    For j = 1 To Len(sn(0))
        For jj = 1 To UBound(sn)
          If Mid(sn(jj), y, 1) &lt;&gt; &quot; &quot; Then Exit For
        Next
        If jj = UBound(sn) + 1 Then c00 = c00 &amp; Mid(sn(0), Len(c00) + 1, y - Len(c00) - 1) &amp; &quot;&#124;&quot;
        y = y + InStr(Mid(sn(0), y + 1), &quot; &quot;)
        If y = Len(sn(0)) Then Exit For
    Next
    c00 = c00 &amp; Right(sn(0), y - Len(c00))
    
    For j = 10 To 2 Step -1
      c00 = Replace(c00, String(j, &quot;&#124;&quot;), &quot;&#124;&quot; &amp; Space(j - 1))
    Next
    sp = Split(c00, &quot;&#124;&quot;)
    
    For j = 0 To UBound(sn)
      c01 = &quot;&quot;
      For jj = 0 To UBound(sp)
         c01 = c01 &amp; Mid(sn(j), Len(c01) + 1, Len(sp(jj))) &amp; &quot;,&quot;
      Next
      sn(j) = Left(c01, Len(sn(j)))
    Next
    CreateObject(&quot;scripting.filesystemobject&quot;).createtextfile(&quot;G:\OF\0_fixedwidth_example_001.csv&quot;).write Join(sn, vbCrLf)
    
    Workbooks.Open &quot;G:\OF\0_fixedwidth_example_001.csv&quot;
End Sub&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>No harm done, just a slight amendment:</p>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #E56717; font-weight: bold;">Sub</span> M_snb()<br />
&nbsp; &nbsp; sn = Filter(Filter(Split(Replace(<span style="color: #E56717; font-weight: bold;">CreateObject</span>(<span style="color: #800000;">&quot;scripting.filesystemobject&quot;</span>).opentextfile(<span style="color: #800000;">&quot;G:\OF\0_fixedwidth_example_001.txt&quot;</span>).readall, <span style="color: #800000;">&quot;,&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>), vbCrLf), Space(60), <span style="color: #00C2FF; font-weight: bold;">False</span>), <span style="color: #800000;">&quot;/&quot;</span>)<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; y = InStr(sn(0), <span style="color: #800000;">&quot; &quot;</span>)<br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> j = 1 <span style="color: #8D38C9; font-weight: bold;">To</span> Len(sn(0))<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> jj = 1 <span style="color: #8D38C9; font-weight: bold;">To</span> <span style="color: #151B8D; font-weight: bold;">UBound</span>(sn)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">If</span> Mid(sn(jj), y, 1) &lt;&gt; <span style="color: #800000;">&quot; &quot;</span> <span style="color: #8D38C9; font-weight: bold;">Then</span> <span style="color: #E56717; font-weight: bold;">Exit</span> <span style="color: #8D38C9; font-weight: bold;">For</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">If</span> jj = <span style="color: #151B8D; font-weight: bold;">UBound</span>(sn) + 1 <span style="color: #8D38C9; font-weight: bold;">Then</span> c00 = c00 &amp; Mid(sn(0), Len(c00) + 1, y - Len(c00) - 1) &amp; <span style="color: #800000;">&quot;|&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; y = y + InStr(Mid(sn(0), y + 1), <span style="color: #800000;">&quot; &quot;</span>)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">If</span> y = Len(sn(0)) <span style="color: #8D38C9; font-weight: bold;">Then</span> <span style="color: #E56717; font-weight: bold;">Exit</span> <span style="color: #8D38C9; font-weight: bold;">For</span><br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; &nbsp; c00 = c00 &amp; Right(sn(0), y - Len(c00))<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> j = 10 <span style="color: #8D38C9; font-weight: bold;">To</span> 2 <span style="color: #8D38C9; font-weight: bold;">Step</span> -1<br />
&nbsp; &nbsp; &nbsp; c00 = Replace(c00, <span style="color: #F660AB; font-weight: bold;">String</span>(j, <span style="color: #800000;">&quot;|&quot;</span>), <span style="color: #800000;">&quot;|&quot;</span> &amp; Space(j - 1))<br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; &nbsp; sp = Split(c00, <span style="color: #800000;">&quot;|&quot;</span>)<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> j = 0 <span style="color: #8D38C9; font-weight: bold;">To</span> <span style="color: #151B8D; font-weight: bold;">UBound</span>(sn)<br />
&nbsp; &nbsp; &nbsp; c01 = <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> jj = 0 <span style="color: #8D38C9; font-weight: bold;">To</span> <span style="color: #151B8D; font-weight: bold;">UBound</span>(sp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c01 = c01 &amp; Mid(sn(j), Len(c01) + 1, Len(sp(jj))) &amp; <span style="color: #800000;">&quot;,&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; &nbsp; &nbsp; sn(j) = Left(c01, Len(sn(j)))<br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; &nbsp; <span style="color: #E56717; font-weight: bold;">CreateObject</span>(<span style="color: #800000;">&quot;scripting.filesystemobject&quot;</span>).createtextfile(<span style="color: #800000;">&quot;G:\OF\0_fixedwidth_example_001.csv&quot;</span>).write Join(sn, vbCrLf)<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Workbooks.<span style="color: #151B8D; font-weight: bold;">Open</span> <span style="color: #800000;">&quot;G:\OF\0_fixedwidth_example_001.csv&quot;</span><br />
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Sub</span></div></div>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Importing Fixed Width Text Files with ActiveX Data Objects by Dick Kusleika</title>
		<link>http://dailydoseofexcel.com/archives/2013/05/10/importing-fixed-width-text-files-with-activex-data-objects/#comment-92048</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Mon, 13 May 2013 14:02:53 +0000</pubDate>
		<guid isPermaLink="false">http://dailydoseofexcel.com/?p=7918#comment-92048</guid>
		<description><![CDATA[That didn&#039;t work on my sample data

&lt;img src=&quot;/blogpix/fixedwidthtocsv.gif&quot; height=&quot;310&quot; width=&quot;903&quot; alt=&quot;&quot; /&gt;]]></description>
		<content:encoded><![CDATA[<p>That didn&#8217;t work on my sample data</p>
<p><img src="/blogpix/fixedwidthtocsv.gif" height="310" width="903" alt="" /></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Importing Fixed Width Text Files with ActiveX Data Objects by snb</title>
		<link>http://dailydoseofexcel.com/archives/2013/05/10/importing-fixed-width-text-files-with-activex-data-objects/#comment-92045</link>
		<dc:creator>snb</dc:creator>
		<pubDate>Mon, 13 May 2013 12:00:36 +0000</pubDate>
		<guid isPermaLink="false">http://dailydoseofexcel.com/?p=7918#comment-92045</guid>
		<description><![CDATA[Wouldn&#039;t this be sufficient ?

&lt;code lang=&quot;VB&quot;&gt;Sub M_snb()
  sn = Filter(Filter(Split(CreateObject(&quot;scripting.filesystemobject&quot;).opentextfile(&quot;G:\OF\0_fixedwidth_example_001.txt&quot;).readall, vbCrLf), Space(60), False), &quot;/&quot;)
    
  y = InStr(sn(0), &quot; &quot;)
  For j = 1 To Len(sn(0))
    For jj = 1 To UBound(sn)
      If Mid(sn(jj), y, 1) &lt;&gt; &quot; &quot; Then Exit For
    Next
    If jj = UBound(sn) + 1 Then c00 = c00 &amp; Mid(sn(0), Len(c00) + 1, y - Len(c00) - 1) &amp; &quot;&#124;&quot;
    y = y + InStr(Mid(sn(0), y + 1), &quot; &quot;)
    If y = Len(sn(0)) Then Exit For
  Next
  c00 = c00 &amp; Right(sn(0), y - Len(c00))
    
  For j = 10 To 2 Step -1
    c00 = Replace(c00, String(j, &quot;&#124;&quot;), &quot;&#124;&quot; &amp; Space(j - 1))
  Next
  sp = Split(c00, &quot;&#124;&quot;)
    
  For j = 0 To UBound(sn)
    c01 = &quot;&quot;
    For jj = 0 To UBound(sp)
      c01 = c01 &amp; Mid(sn(j), Len(c01) + 1, Len(sp(jj))) &amp; &quot;,&quot;
    Next
    sn(j) = Left(c01, Len(sn(j)))
  Next
  CreateObject(&quot;scripting.filesystemobject&quot;).createtextfile(&quot;G:\OF\0_fixedwidth_example_001.csv&quot;).write Join(sn, vbCrLf)
    
  Workbooks.Open &quot;G:\OF\0_fixedwidth_example_001.csv&quot;
End Sub&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t this be sufficient ?</p>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #E56717; font-weight: bold;">Sub</span> M_snb()<br />
&nbsp; sn = Filter(Filter(Split(<span style="color: #E56717; font-weight: bold;">CreateObject</span>(<span style="color: #800000;">&quot;scripting.filesystemobject&quot;</span>).opentextfile(<span style="color: #800000;">&quot;G:\OF\0_fixedwidth_example_001.txt&quot;</span>).readall, vbCrLf), Space(60), <span style="color: #00C2FF; font-weight: bold;">False</span>), <span style="color: #800000;">&quot;/&quot;</span>)<br />
&nbsp; &nbsp; <br />
&nbsp; y = InStr(sn(0), <span style="color: #800000;">&quot; &quot;</span>)<br />
&nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> j = 1 <span style="color: #8D38C9; font-weight: bold;">To</span> Len(sn(0))<br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> jj = 1 <span style="color: #8D38C9; font-weight: bold;">To</span> <span style="color: #151B8D; font-weight: bold;">UBound</span>(sn)<br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">If</span> Mid(sn(jj), y, 1) &lt;&gt; <span style="color: #800000;">&quot; &quot;</span> <span style="color: #8D38C9; font-weight: bold;">Then</span> <span style="color: #E56717; font-weight: bold;">Exit</span> <span style="color: #8D38C9; font-weight: bold;">For</span><br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">If</span> jj = <span style="color: #151B8D; font-weight: bold;">UBound</span>(sn) + 1 <span style="color: #8D38C9; font-weight: bold;">Then</span> c00 = c00 &amp; Mid(sn(0), Len(c00) + 1, y - Len(c00) - 1) &amp; <span style="color: #800000;">&quot;|&quot;</span><br />
&nbsp; &nbsp; y = y + InStr(Mid(sn(0), y + 1), <span style="color: #800000;">&quot; &quot;</span>)<br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">If</span> y = Len(sn(0)) <span style="color: #8D38C9; font-weight: bold;">Then</span> <span style="color: #E56717; font-weight: bold;">Exit</span> <span style="color: #8D38C9; font-weight: bold;">For</span><br />
&nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; c00 = c00 &amp; Right(sn(0), y - Len(c00))<br />
&nbsp; &nbsp; <br />
&nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> j = 10 <span style="color: #8D38C9; font-weight: bold;">To</span> 2 <span style="color: #8D38C9; font-weight: bold;">Step</span> -1<br />
&nbsp; &nbsp; c00 = Replace(c00, <span style="color: #F660AB; font-weight: bold;">String</span>(j, <span style="color: #800000;">&quot;|&quot;</span>), <span style="color: #800000;">&quot;|&quot;</span> &amp; Space(j - 1))<br />
&nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; sp = Split(c00, <span style="color: #800000;">&quot;|&quot;</span>)<br />
&nbsp; &nbsp; <br />
&nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> j = 0 <span style="color: #8D38C9; font-weight: bold;">To</span> <span style="color: #151B8D; font-weight: bold;">UBound</span>(sn)<br />
&nbsp; &nbsp; c01 = <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">For</span> jj = 0 <span style="color: #8D38C9; font-weight: bold;">To</span> <span style="color: #151B8D; font-weight: bold;">UBound</span>(sp)<br />
&nbsp; &nbsp; &nbsp; c01 = c01 &amp; Mid(sn(j), Len(c01) + 1, Len(sp(jj))) &amp; <span style="color: #800000;">&quot;,&quot;</span><br />
&nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; &nbsp; sn(j) = Left(c01, Len(sn(j)))<br />
&nbsp; <span style="color: #8D38C9; font-weight: bold;">Next</span><br />
&nbsp; <span style="color: #E56717; font-weight: bold;">CreateObject</span>(<span style="color: #800000;">&quot;scripting.filesystemobject&quot;</span>).createtextfile(<span style="color: #800000;">&quot;G:\OF\0_fixedwidth_example_001.csv&quot;</span>).write Join(sn, vbCrLf)<br />
&nbsp; &nbsp; <br />
&nbsp; Workbooks.<span style="color: #151B8D; font-weight: bold;">Open</span> <span style="color: #800000;">&quot;G:\OF\0_fixedwidth_example_001.csv&quot;</span><br />
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Sub</span></div></div>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Consulting by Tim</title>
		<link>http://dailydoseofexcel.com/excel-consulting-buyers-guide/#comment-91988</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Sat, 11 May 2013 01:46:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?page_id=8#comment-91988</guid>
		<description><![CDATA[This is really, really helpful.  Thanks a lot for putting it together.]]></description>
		<content:encoded><![CDATA[<p>This is really, really helpful.  Thanks a lot for putting it together.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Importing Fixed Width Text Files with ActiveX Data Objects by Dick Kusleika</title>
		<link>http://dailydoseofexcel.com/archives/2013/05/10/importing-fixed-width-text-files-with-activex-data-objects/#comment-91985</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Fri, 10 May 2013 17:38:05 +0000</pubDate>
		<guid isPermaLink="false">http://dailydoseofexcel.com/?p=7918#comment-91985</guid>
		<description><![CDATA[Definitely I would use Monarch. It&#039;s pricey though. I sure would like to see their algorithm.]]></description>
		<content:encoded><![CDATA[<p>Definitely I would use Monarch. It&#8217;s pricey though. I sure would like to see their algorithm.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Importing Fixed Width Text Files with ActiveX Data Objects by Zach</title>
		<link>http://dailydoseofexcel.com/archives/2013/05/10/importing-fixed-width-text-files-with-activex-data-objects/#comment-91984</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Fri, 10 May 2013 15:55:35 +0000</pubDate>
		<guid isPermaLink="false">http://dailydoseofexcel.com/?p=7918#comment-91984</guid>
		<description><![CDATA[Very impressive.  Also very complicated.  I know that Excel is your hammer of choice (mine too!), but I have to wonder if it doesn&#039;t make more sense to just use a dedicated text import program and be done with it.  Monarch would handle this quite easily and more robustly.  Heck, even if you insist on using Excel, you can always use the object model to call it into being in the background.

I do love my ADO, though.  I will definitely keep this in mind if I ever have to deliver a packaged solution and cannot rely on external functionality.]]></description>
		<content:encoded><![CDATA[<p>Very impressive.  Also very complicated.  I know that Excel is your hammer of choice (mine too!), but I have to wonder if it doesn&#8217;t make more sense to just use a dedicated text import program and be done with it.  Monarch would handle this quite easily and more robustly.  Heck, even if you insist on using Excel, you can always use the object model to call it into being in the background.</p>
<p>I do love my ADO, though.  I will definitely keep this in mind if I ever have to deliver a packaged solution and cannot rely on external functionality.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
