Hi This must be a very simple question but I could not find the answer in the Documentation Center. I am importing data from a file that contains two columns of numbers:
data = Import["myfile.txt"]
How can I access a specific element in the data array, e.g. column 1, row 3?
Thank you, that has worked!
Looks like the file has been imported as a single String rather than a List of lists. Also looks like the columns in the file are TAB separated. If so, try
String
List
data = Import["Data1.txt", "TSV"] data[[2,2]]
Thank you but that does not work. The array 'data' must be having a different structure.
I am attaching two images which show the output for data and for Part:
You can use Part.
E.g.: data = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; data[[3,1]] 7