In Go programming language, Bufio and io package functions will be used to read the text from the given file. In this article, we will use three Examples to read lines from the existing file. In the first Example, we will use NewReader function from the bufio package, in the second Example we will use ReadFile function from ioutil package and in the third Example we will use file.Read function respectively. Syntax func Split(str, sep string) []string Split() function is used to split a string through a provided separator. This function is present in strings package and it accepts ... Read More
In this Golang article we will use ReadFile function from the io/ioutil package, NewScanner function from the bufio packageand as well as NewReader function from the former package respectively to read entire text from the xis=sting file. Syntax bufio.NewReader() This function belongs to Go's bufio package. The primary goal of this function is to read the data in larger chunks instead of line by line and store in buffer. The io.reader and buffer size are passed as arguments in this function. os.Open() This function is a part of os package. It is used to open a file to ... Read More
Fiber optics is one of the technologies used to transmit data through thin glass or plastic fibers. It is mostly used in communication channels like telephone, televisions, and the Internet. Core and cladding are two parts of fiber optic cable. The cladding reflects the light to the core, thus preventing the loss of signal. Fiber optics are mostly used in medical and industry services. In the medical field, it is used for endoscopies, to view and treat internal organs. In industries, it is used in controlling temperature, pressure, and vibrations. Fiber Optics and its Types Definition Fiber optics is defined ... Read More
In ISO OSI layers there are seven layers, and each layer has its characteristics and its protocols. The most important second layer from the bottom is the data link layer. In this data link layer consists of two different layers and MAC is one important layer. MAC is the Medium Access Control layer. MAC layer helps to reduce the collision while transmitting the data. The main functionality of the MAC layer will act as a medium to access the shared resources in the network. So it has the control accessibility of nodes when they are in a shared medium. MAC ... Read More
The information system is the process of correct management and flow of data in a system such that the information reaches its correct receiver. It also collects data, analyzes them, and communicates the appropriate information to users of the information system. It is mostly used in organizations for data collection and distribution. It is also used to establish a communication system with customers to manage various operations. It is a collection of hardware, software, and other elements which work together in correct sync to establish its fundamental requirement. This system accepts various formats of data and performs different types ... Read More
In golang we can use ioutile.ReadFile() to read the file and for loop timer, we will limit the character numbers to read, Os.Open and bufio.NewReader function to perform the execution as well as file.Read() respectively. In this article we will learn how to use the OS asnd bufio package of Golang to read the specified number of characters from the existing file. Syntax ioutil.ReadFile(file) The ReadFile() function is present in ioutil package and is used to read the given file. The function accepts the file to be read as argument to the function. To read a specified number of ... Read More
In this golang article, we are going to use os.OpenFile() and ioutil.Readfile() to append the given file without truncating it. In the first Example, we are going to Os.Openfile to access the file and then by using file.WriteString function we will append it. In the second Example, we will use ioutil, ReadFile(), ioutil.WriteFile() and Append() functions to perform the same operation on the file without truncating it respectively. Syntax file.read() The Read() function is used to read the contents of a file. The function accepts the file whose contents are to be read as an argument and returns the ... Read More
In Golang, read-only mode refers to a mode of operation in which a file, directory, or device can only be viewed or read, but not modified or deleted. This mode is used to prevent accidental changes in the data. In computer systems, the read-only mode can be set at the file or folder level, or it can be set for an entire disk or partition. In this article, we will use three Examples to open a file in read-only mode. In the first Example we will use open function from the os package, in the second Example we will use ... Read More
In golang we can os.Openfile function of os package and ioutil.WriteFile() function of ioutil package to append a file. Then, we will use WriteString() function to print the result. In this article, we are going to learn how to create a golang programt to open a file in append mode incase the file does not exist. Syntax os.OpenFile(name/path string, flag int, perm FileMode) The OpenFile() function is present in os package. The function accepts three arguments. One is the name of the file that is to be opened followed by the int type instruction used to open a ... Read More
In Go programming language, os and io packages can be used for performing various operations on external files like copying, editing, and even appending them. In this article, we will learn two Examples to open a file in append mode. In the first Example we will use os.OpenFile function from os package and in the second Example we will use ioutil.WriteFile function from ioutil package. Syntax os.OpenFile("test.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) The OpenFile() function is present in os package and is used to open a file. The function accepts the file to be opened as argument to the function along with ... Read More
 
 Data Structure
 Data Structure Networking
 Networking RDBMS
 RDBMS Operating System
 Operating System Java
 Java MS Excel
 MS Excel iOS
 iOS HTML
 HTML CSS
 CSS Android
 Android Python
 Python C Programming
 C Programming C++
 C++ C#
 C# MongoDB
 MongoDB MySQL
 MySQL Javascript
 Javascript PHP
 PHP 
		