0

I have some data in Excel file and I need to share it with somebody. The other side has specific requirements to the format: text file, *.dat name, pipe-separated, etc..

So I created a VBA-code to extract the data into a text file using the examples from this site.

At the moment my file is not being accepted because: "It's not a UTF-8 UNIX format". I tried multiple solutions from the internet but each time I receive an answer that it's either "UTF-8 PC format" or "Unicode format".

Can somebody help me to solve this? Here's what I have so far:

'create output (this is from my initial version)
Set Fileout = fso.CreateTextFile(myFile, True, True)
For y = 2 To a
Fileout.WriteLine .Cells(y, 59)
Next y
Fileout.Close

'this is from my second conversion attempt, where I received UTF-8 PC format
Set stream = CreateObject("ADODB.Stream")
stream.Open
stream.Position = 0
stream.Charset = "UTF-8"
stream.LoadFromFile myFile

'This is my latest try. I found something called "UTF-8 without BOM" on the internet. Still doesn't work.
Set StreamUnixUtf = CreateObject("ADODB.Stream")
StreamUnixUtf.Type = 1
StreamUnixUtf.Mode = 3
StreamUnixUtf.Open
stream.Position = 3
stream.CopyTo StreamUnixUtf
stream.Flush
stream.Close
StreamUnixUtf.SaveToFile myFileUnixUTF, 2
StreamUnixUtf.Close

Thank you in advance for your help.

  • Possible duplicate of [Anything like DOS2Unix for WIndows?](http://stackoverflow.com/questions/20368781/anything-like-dos2unix-for-windows) – Ron Rosenfeld Dec 13 '16 at 11:43

1 Answers1

0

How about TextWrangler (mac) or Programmer's file editor (PC) and select unix line feed - have this when I need to submit a file onto a specific system...

Solar Mike
  • 7,156
  • 4
  • 17
  • 32
  • Hi. Unfortunately in this case I can't use any other software than Excel. – ALC1986 Dec 14 '16 at 08:27
  • Then one other work-around you may consider is to open a file in excel of the correct type, edit the bits and save, but not sure if it will solve your issue. – Solar Mike Dec 14 '16 at 09:22