I have a txt file like this:
A B C
400 2 3
2 1 8
Now I would like to import the txt file and write it all on one line instead of in columns, so like that:
A B C 400 2 3 2 1 8
How can I achieve this with Mathematica ?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityStringRiffle[ReadList["C:/temp/temp.txt", Word], " "]
ReadList
and Part
are excellent; start there. E.g., ReadList[StringToStream@"ABC 123 BCD 234 EFG 345", {Word, Number}][[All,2]]
.
$\endgroup$