Excel Mac - Some txt files can't be opened/imported ("Grayed out")

Solution 1:

I think I've got an answer.

Googling around I've found references to "grayed out" problems and mentions of the file's creator attribute.

So a quick Google for "osx file creator mark" pointed me to SetFileand its sibling GetFileInfo.

Running a quick GetFileInfo on the files I get:

Mac:samples jjarava$ for i in 201507*.TXT; do getfileinfo "$i"; echo .; done
file: "/path/to/samples/20150728 - Source Fragment 3 (BAD).TXT"
type: "????"
creator: "????"
attributes: avbstclinmedz
created: 08/03/2015 13:58:18
modified: 08/03/2015 13:58:18
.
file: "/path/to/samples/20150728 - Source Framgent 1 (Good).TXT"
type: "TEXT"
creator: "\0\0\0\0"
attributes: avbstclinmedz
created: 08/03/2015 13:58:18
modified: 08/03/2015 13:58:18
.
file: "/path/to/samples/20150728 - Source Framgent 2 (Good).TXT"
type: "TEXT"
creator: "\0\0\0\0"
attributes: avbstclinmedz
created: 08/03/2015 13:58:18
modified: 08/03/2015 13:58:18
.
file: "/path/to/samples/20150728 - Source (BAD).TXT"
type: "????"
creator: "????"
attributes: avbstclinmedz
created: 08/03/2015 13:58:18
modified: 08/03/2015 13:58:18
.
file: "/path/to/samples/20150728 - Source Fragment 3 copy (BAD).TXT"
type: "????"
creator: "????"
attributes: avbstclinmedz
created: 08/03/2015 13:58:18
modified: 08/03/2015 13:58:18
.

All the "working" files are of type: "TEXT", and all the "not working" ones seem not to have a "type" defined...

Actually, running the following to change the file type:

Mac:samples jjarava$ setfile -t TEXT "20150728 - Source Fragment 3 copy (BAD).TXT"
Mac:samples jjarava$ getfileinfo "20150728 - Source Fragment 3 copy (BAD).TXT"
file: "/path/to/samples/20150728 - Source Fragment 3 copy (BAD).TXT"
type: "TEXT"
creator: "????"
attributes: avbstclinmedz
created: 08/03/2015 13:58:18
modified: 08/03/2015 13:58:18

And that file can now be selected in the "Open" dialog in Excel!!

The question is where does the "type" field come from, and why it's set in some files and not in others, but at least there's some "logic" to the issue!!