excel - VBA Reading From a UCS-2 Little Endian Encoded Text File -


I have a whole bunch of text files that are exported from Photoshop, importing me into an Excel document Will happen. I wrote a macro to work and it worked fine for my test document, but when I tried to load some real files created by Photoshop Excel then insert all the data in a separate column except the first line Started.

My code that reads the text file: Open the currentDocPath for input as input stream to stream # stream, find the current row column = Split (current, vbTab) value = column content (n) next en line = row + 1 loop off stream p> text files I'm reading this way, only more With data: "data" "Blah 2"

The problem looks very trivial, but when I load it in Excel, it looks like the top, it looks like it looks like this:

 Now I'm not sure why this is happening, it looks like the first line in the first line is:  ÃÆ'à ¢ â,¬Å¡Ãƒâ € šÃ, "name" "data" "info" "blah" info2 blah2   

There are two letters because they declare byte text encoding. Either way, the first row of those characters is formatted correctly, whereas the remaining rows lose their quotation marks and all are moved to new lines.

Is anyone such a person who understands the UCS-2 Little Endian Text encoding? When I convert the files to ASCII, it works fine.

Cheers! Edit: OK, now I understand that encoding is UTF-16 (I do not fully know about character encoding) My main issue is that it is a strange formatting and I Do not understand how to fix it or how to fix it. Thanks!

As I mentioned in my comment, it seems that the file you want to import The encoding is in UTF-16. In

, someone has suggested that the following should be done:

  retard GetOpenFile string Dim MyData as long as string dim R GetOpenFile = Application.GetOpenFilename Open OpenOpenFile for input as # 1 Open IOF (1) Row Input # 1, do not Maida Cell (R, 1). Price = MyData r = Turn off the r + 1 loop # 1   

Obviously I can not test myself, but maybe this will help you.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -