View Single Post
  #4 (permalink)   Top
Old 7th March 2009, 05:18 PM
wladicus's Avatar
wladicus wladicus is offline wladicus has a Profile Picture
TST Expert
 
Join Date: Sep 2008, 846 posts.
Location: St. Thomas, Ontario, Canada
Reputation: wladicus is on a distinguished road
In which text editor are you trying to do this: Kate, Nano, vi ... ?
I work with Linux on and off.
As I understand it the head and tail commands only list or display the number of lines you specify either from the top or from the bottom of the file.
If you want to change something in a file there are 2 ways to do it.
The easy way is to use a text editor to open the file, look at the contents and use the text editor commands to make the desired changes. vi comes as a standard text editor in Linux, and some others are Kate, Kwrite,nano,and joe. I have used vi, Kwrite, Kate and nano.
The other way to alter a text file is via programming. You can write a routine (script file or other programme file) to perform desired functions on a text file. For example you can parse the text file to search and find a particular phrase and then do what you wish with it. You can also move lines to different places in the file. All this sort of programmed manipulation requires some detailed knowledge of file structure and programming skills, and it is probably not what you are looking for at this stage in your study.
So you probably need to use a text editor to make the changes you want. Not too different from using Notepad in Windows or more accurately it is similar to using something like EDIT.com in DOS to edit a text file.
Hope this helped some.
walt
__________________
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
joy,

walt
St. Thomas, Ontario, Canada = 42.77°N, 81.11°W =
That which appears to be without lies within...wladicus
->http://wladicus.blogspot.com/

Last edited by wladicus; 10th March 2009 at 12:49 AM.
Reply With Quote