Downloading files to my local machine from github

Downloading files to my local machine from github
0.0 0



I am learning spark through Scala. For practice, I need to download data from github that Durga gave for practice. I could not download. If I copy them and save as .txt and give them as source file also, it throws file not found exception. Can anyone please help me out .

I have tried by using two backslash as well as mentioned below:

Plz anyone help me out


can you please post the steps and some screenshots how you downloaded the files?


Thanks for your response.
I am attaching here the screenshots. I am using my office laptop and it has only mozilla browser. Actually i am not sure how to download the file from github. I just tried.

  1. i click on the that leads to durga github
  2. RC on raw gives me the below

3.gave save link as

Try to refer the same in source file. but it didnt read since it is a web reference. can you tell me how to download file from github and use in scala. Thanks a lot in advance.



I have downloaded the electiondata file “ls2014.tsv” to my windows. then I copied to itversity cluster as well . After that I did below
[rkathiravan@gw01 ~]$ hadoop fs -cat /user/rkathiravan/scalaex1.tsv | head
state constituency candidate_name sex age category partyname partysymbol general postal total pct_of_total_votes pct_of_polled_votes totalvoters
Andhra Pradesh Adilabad GODAM NAGESH M 49 ST TRS Car 425762 5085 430847 31.07931864 40.81807244 1386282
Andhra Pradesh Adilabad NARESH M 37 ST INC Hand 257994 1563 259557 18.72324679 24.59020587 1386282
Andhra Pradesh Adilabad RAMESH RATHOD M 48 ST TDP Bicycle 182879 1319 184198 13.28719553 17.45075933 1386282
Andhra Pradesh Adilabad RATHOD SADASHIV M 55 ST BSP Elephant 94363 57 94420 6.81102402 8.945269201 1386282
Andhra Pradesh Adilabad NETHAWATH RAMDAS M 44 ST IND Auto- Rickshaw 41028 4 41032 2.959859538 3.88733622 1386282
Andhra Pradesh Adilabad PAWAR KRISHNA M 33 ST IND Bat 5051 4 5055 0.364644423 0.478906331 1386282
Andhra Pradesh Adilabad BANKA SAHADEV M 53 ST IND Gas Cylinder 4780 7 4787 0.345312137 0.453516243 1386282
Andhra Pradesh Adilabad MOSALI CHINNAIAH M 40 ST IND Almirah 8842 17 8859 0.639047467 0.839294004 1386282
Andhra Pradesh Adilabad None of the Above NOTA NOTA 17021 63 17084 1.232361092 1.618523396 1386282

cat: Unable to write to output stream.


scala> import

scala> val fileName = "/user/rkathiravan/scalaex1.tsv"
fileName: String = /user/rkathiravan/scalaex1.tsv

scala> val results = Source.fromFile(fileName).getLines /user/rkathiravan/scalaex1.tsv (No such file or directory)
at Method)
… 32 elided

why it is unable to write to output stream.
can anyone help out please!!!



i found the answer for

cat:unable to write to output stream

but could anyone help me why file is not reading in scala

scala> val results = Source.fromFile(fileName).getLines /user/rkathiravan/scalaex1.tsv (No such file or directory)

Thanks in advance