I have a .txt file which have following form
Name1 number1 number2 number3
Name2 number4 number5 number6
Name3 number6 number8 number9
I want to import these data as following matrix
new={{number1,number2,number3,number4,number5,number6,number7,number8,number9}}
namely a 1x9 matrix. When I try this code
new = Part[Import["path\filename.txt", "Table"], Range[1, 3],2 ;; 4]
I get a 3x3 matrix as
new={{number1,number2,number3},{number4,number5,number6},{number7,number8,number9}}
due to using the Part command. How can I build a 1x9 matrix where all numbers are placed in one row by importing data from the file or convert the 3x3 matrix obtained from above code to a 1x9 matrix?
Flattentonew. – Henrik Schumacher Apr 09 '18 at 09:42ArrayReshape[new, {1, Times @@ Dimensions[new]}]. – Henrik Schumacher Apr 09 '18 at 13:04ArrayReshape.Times @@ Dimensions[new]just computes $3 \cdot 3 = 9$ in a way that also works for other matrix sized ofnew. – Henrik Schumacher Apr 09 '18 at 13:33Uncompress["1:eJxTTMoPClZiYGAoTs4ozU1MzkgtcsjMKy7JTSzJ0CsqL8nQTQQJ5umlpAIANGgO/A=="]. (Execute the command in Mathematica.) But also this site provides much helpful info for new users. – Henrik Schumacher Apr 09 '18 at 14:11