Skip to main content
2 of 4
added 64 characters in body
John Taylor
  • 6.1k
  • 2
  • 18
  • 36

How to import the following file as a dataset?

Consider a file 'temp.txt' (alternative link). I am trying to import it as a data-file, i.e. in the form

XXX XXX XXX XXX XXX 

where XXX denotes numbers. To do this, first I need to remove the first 3 strings containing words and rows with four columns. However, I am not able to do this. My attempt was the following (assuming that temp.txt is located in the notebook's directory):

file = Drop[Import[ FileNameJoin[{NotebookDirectory[], "temp.txt"}], "Data"], 3] 

with the output file[[1]] containing many non-numeric rows. Could you please show me how to fix it?

John Taylor
  • 6.1k
  • 2
  • 18
  • 36