I'm trying to import a .txt file from my local computer into a databricks notebook (scala). I go into the data section and click "add data". The "upload file" option is selected in the top panel, I click browse to find the file and then "Create table in Notebook". I then get a path to the file but when I try to access the data in another notebook through the command "val file_location = "/FileStore/tables/....txt" I get a "java.io.FileNotFoundException: /FileStore/tables/....txt (No such file or directory)". Does anybody know what I'm doing wrong here and what I should do instead?
Kind regards
Format should be
text
, nottxt
. See the documentation:Or you can use
spark.read.textFile
function that is really shortcut for that: