Skip to main content
Tweeted twitter.com/StackMma/status/1478335411671998468
Became Hot Network Question
added 123 characters in body
Source Link
tobalt
  • 357
  • 1
  • 6

I have the following file TSV file p.txt containing a single line of 3 values:

"22p" "22o" "22u"

(The actual files are many lines, i.e. 2D, but I'm sticking to this minimum example)

Using either Import["p.txt", "TSV"] or Import["p.txt", "Table"] produces the same unintended output of:

{{22, "22o", "22u"}}

I.e. the first entry is falsely interpreted as a value and the letter "p" is removed. I would like to have every entry interpreted as a string. How to achieve this?

I probably cannot useknow how to do it using the ReadList command. But I probably cannot use it as I rely on the CharacterEncoding->"Unicode" option of Import for the data files. If there is another way to resepct the files Byte Encoding, I could also use ReadList.

I have the following file TSV file p.txt containing a single line of 3 values:

"22p" "22o" "22u"

(The actual files are many lines, i.e. 2D, but I'm sticking to this minimum example)

Using either Import["p.txt", "TSV"] or Import["p.txt", "Table"] produces the same unintended output of:

{{22, "22o", "22u"}}

I.e. the first entry is falsely interpreted as a value and the letter "p" is removed. I would like to have every entry interpreted as a string. How to achieve this?

I probably cannot use the ReadList command as I rely on the CharacterEncoding->"Unicode" option of Import for the data files.

I have the following file TSV file p.txt containing a single line of 3 values:

"22p" "22o" "22u"

(The actual files are many lines, i.e. 2D, but I'm sticking to this minimum example)

Using either Import["p.txt", "TSV"] or Import["p.txt", "Table"] produces the same unintended output of:

{{22, "22o", "22u"}}

I.e. the first entry is falsely interpreted as a value and the letter "p" is removed. I would like to have every entry interpreted as a string. How to achieve this?

I know how to do it using the ReadList command. But I probably cannot use it as I rely on the CharacterEncoding->"Unicode" option of Import for the data files. If there is another way to resepct the files Byte Encoding, I could also use ReadList.

added 201 characters in body
Source Link
tobalt
  • 357
  • 1
  • 6

I have the following file TSV file p.txt containing a single line of 3 values:

"22p" "22o" "22u"

(The actual files are many lines, i.e. 2D, but I'm sticking to this minimum example)

Using either Import["p.txt", "TSV"] or Import["p.txt", "Table"] produces the same unintended output of:

{{22, "22o", "22u"}}

I.e. the first entry is falsely interpreted as a value and the letter "p" is removed. I would like to have every entry interpreted as a string. How to achieve this?

I probably cannot use the ReadList command as I rely on the CharacterEncoding->"Unicode" option of Import for the data files.

I have the following file TSV file p.txt containing a single line of 3 values:

"22p" "22o" "22u"

(The actual files are many lines, i.e. 2D, but I'm sticking to this minimum example)

Using either Import["p.txt", "TSV"] or Import["p.txt", "Table"] produces the same unintended output of:

{{22, "22o", "22u"}}

I.e. the first entry is falsely interpreted as a value and the letter "p" is removed. I would like to have every entry interpreted as a string. How to achieve this?

I have the following file TSV file p.txt containing a single line of 3 values:

"22p" "22o" "22u"

(The actual files are many lines, i.e. 2D, but I'm sticking to this minimum example)

Using either Import["p.txt", "TSV"] or Import["p.txt", "Table"] produces the same unintended output of:

{{22, "22o", "22u"}}

I.e. the first entry is falsely interpreted as a value and the letter "p" is removed. I would like to have every entry interpreted as a string. How to achieve this?

I probably cannot use the ReadList command as I rely on the CharacterEncoding->"Unicode" option of Import for the data files.

Source Link
tobalt
  • 357
  • 1
  • 6

Importing textual data removes some letters

I have the following file TSV file p.txt containing a single line of 3 values:

"22p" "22o" "22u"

(The actual files are many lines, i.e. 2D, but I'm sticking to this minimum example)

Using either Import["p.txt", "TSV"] or Import["p.txt", "Table"] produces the same unintended output of:

{{22, "22o", "22u"}}

I.e. the first entry is falsely interpreted as a value and the letter "p" is removed. I would like to have every entry interpreted as a string. How to achieve this?