September 2017
Intermediate to advanced
466 pages
9h 33m
English
In this section, you will learn how to swap the values of two fields of each line of a text file, provided they are in the correct format. This mainly happens in log files or other text files where you want to scan a line for certain types of data, and if the data is found, you might need to do something with them: in this case, you will change the place of the two values.
The name of the program will be swapRE.go, and it will be presented in four parts. Once again, the program will read a text file line by line and try to match the desired strings before swapping them. The utility will print the contents of the new file on the screen; it is the responsibility of the user to save the results to a new ...
Read now
Unlock full access