To read a file line by line the bufio package Scanner is used. Let the text file be named as sample.txt and the content inside the file is as follows:
GO Language is a statically compiled programming language, It is an open-source language. It was designed at Google by Rob Pike, Ken Thompson, and Robert Grieserner. It is also known as Golang. Go language is a general-purpose programming language mainly meant for building large scale complex software.
- How to read a file line by line using node.js ?
- io.SectionReader.Read() Function in Golang with Examples
- io.PipeReader.Read() Function in Golang with Examples
- How to Read and Write the Files in Golang?
- How to read and write JSON file using Node.js ?
- Java Program to Make a File Read-Only
- How to Create an Empty File in Golang?
- How to Rename and Move a File in Golang?
- How to Delete or Remove a File in Golang?
- How to Truncate a File in Golang?
- Checking the Given File Exists or Not in Golang
- How to Uncompress a File in Golang?
- Compressing a File in Golang
- Command Line Arguments in Golang
- How to get file input by selected file name without path using jQuery ?
- How to reset selected file with input tag file type in Angular 9?
- How to execute TypeScript file using command line?
- Dirty read in SQL
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.