Microsoft KB Archive/103023: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 22: Line 22:
== SYMPTOMS ==
== SYMPTOMS ==


The versions of Microsoft Excel listed above may incorrectly parse text files that contain curly quotation marks ("smart quotes").
The versions of Microsoft Excel listed above may incorrectly parse text files that contain curly quotation marks ("smart quotes").


<br />
<br />
Line 38: Line 38:
# Click OK.
# Click OK.


NOTE: This procedure must be done accurately; otherwise, you will receive a &quot;Parse line error&quot; message.<br />
NOTE: This procedure must be done accurately; otherwise, you will receive a "Parse line error" message.<br />
<br />
<br />
Or, before you import the text file in Microsoft Excel, open the file in any text editor that has a replace feature and replace the smart quotes with normal quotation marks.
Or, before you import the text file in Microsoft Excel, open the file in any text editor that has a replace feature and replace the smart quotes with normal quotation marks.
Line 47: Line 47:
== MORE INFORMATION ==
== MORE INFORMATION ==


In most word processors, when you create a comma-delimited file, text strings can be kept together by enclosing the string in &quot;smart&quot; quotes or in normal quotation marks, as in the following example:<br />
In most word processors, when you create a comma-delimited file, text strings can be kept together by enclosing the string in "smart" quotes or in normal quotation marks, as in the following example:<br />
<br />
<br />




<pre class="FIXEDTEXT">  &quot;123 Main Street, NE&quot;,123 South Street, WA </pre>
<pre class="FIXEDTEXT">  "123 Main Street, NE",123 South Street, WA </pre>
<br />
<br />
<br />
<br />
When you parse the above text string in Microsoft Excel, &quot;NE&quot; correctly remains part of the text string &quot;123 Main Street, NE,&quot; and the text strings &quot;123 South Street&quot; and &quot;WA&quot; are correctly considered two separate text strings and parsed into separate columns.<br />
When you parse the above text string in Microsoft Excel, "NE" correctly remains part of the text string "123 Main Street, NE," and the text strings "123 South Street" and "WA" are correctly considered two separate text strings and parsed into separate columns.<br />
<br />
<br />
However, if the text string above contains &quot;smart&quot; quotes instead of normal quotation marks, the text may not be parsed as expected. If the text file is imported with the delimiter set as a comma, the text string will be parsed as if the quotation marks were not there. That is, in the example above, the text &quot;123 Main Street&quot; is entered in one cell and &quot;NE&quot; in another.
However, if the text string above contains "smart" quotes instead of normal quotation marks, the text may not be parsed as expected. If the text file is imported with the delimiter set as a comma, the text string will be parsed as if the quotation marks were not there. That is, in the example above, the text "123 Main Street" is entered in one cell and "NE" in another.


<br />
<br />
Line 63: Line 63:
== REFERENCES ==
== REFERENCES ==


&quot;User's Guide 2,&quot; version 4.0, pages 150-151<br />
"User's Guide 2," version 4.0, pages 150-151<br />
&quot;User's Guide,&quot; version 3.0, page 340
"User's Guide," version 3.0, page 340


Additional query words: 4.00a XL4 XL3 curly curled
Additional query words: 4.00a XL4 XL3 curly curled

Latest revision as of 09:24, 20 July 2020

XL: CSV Text File with Smart Quotes Not Parsed As Expected



The information in this article applies to:


  • Microsoft Excel for Windows, versions 2.x, 3.0, 4.0, 4.0a
  • Microsoft Excel for OS/2, versions 2.2, 3.0
  • Microsoft Excel for the Macintosh, versions 2.2, 3.0, 4.0





SYMPTOMS

The versions of Microsoft Excel listed above may incorrectly parse text files that contain curly quotation marks ("smart quotes").



WORKAROUND

For Microsoft Excel to correctly parse the data, you must manually set the points at which the text string should be parsed. The steps below describe how to do this:


  1. Select the data in the worksheet that you want to parse.
  2. On the Data menu, click Parse.
  3. In the Parse line, use brackets to enclose the text that you want to remain together.
  4. Click OK.

NOTE: This procedure must be done accurately; otherwise, you will receive a "Parse line error" message.

Or, before you import the text file in Microsoft Excel, open the file in any text editor that has a replace feature and replace the smart quotes with normal quotation marks.



MORE INFORMATION

In most word processors, when you create a comma-delimited file, text strings can be kept together by enclosing the string in "smart" quotes or in normal quotation marks, as in the following example:


   "123 Main Street, NE",123 South Street, WA 



When you parse the above text string in Microsoft Excel, "NE" correctly remains part of the text string "123 Main Street, NE," and the text strings "123 South Street" and "WA" are correctly considered two separate text strings and parsed into separate columns.

However, if the text string above contains "smart" quotes instead of normal quotation marks, the text may not be parsed as expected. If the text file is imported with the delimiter set as a comma, the text string will be parsed as if the quotation marks were not there. That is, in the example above, the text "123 Main Street" is entered in one cell and "NE" in another.



REFERENCES

"User's Guide 2," version 4.0, pages 150-151
"User's Guide," version 3.0, page 340

Additional query words: 4.00a XL4 XL3 curly curled

Keywords :
Version : WINDOWS:2.0,3.0,4.0,4.0a; OS/2:2.2,3.0; MACINTOSH:2.2,3.0,4.0
Platform : MACINTOSH OS/2 WINDOWS
Issue type :
Technology :


Last Reviewed: December 23, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.