My application interfa开发者_JAVA百科ces with Excel using tab-delimited Unicode text files. I require that some cells have multiple lines (alt-enter in Excel, produces LF character (10)).
If I right-click on the txt file in Explorer and Open With..Excel, it opens correctly. However, if I open Excel, and from within Excel either open the txt file by browsing to it, or open it through the Most Recently Used list, it treats the LF as a CR and creates a new row starting at that point.
How can I get Excel to open the file correctly from within Excel (i.e., open the file the same way as if I had right-clicked on it in Explorer and selected Open With..Excel)?
Edit: Chris Persichetti provided a lot of good information on a related question here.
I think that you should try this: on the ribbon, click the Data tab, then in the "Get External Data" section, click "From Text". this allows you to customize how excel opens the text file.
精彩评论