LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-29-2009, 08:04 AM   #1
rdhanek
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 0
how can i add a keyword after the field2 in a log file


Hi,

I am trying to add a keyword to every line after the field2. Can any one help with this.
The sample output is as follows.
Code:
1234 john keyword 2345
kathy 1256 keyword 3456
 
Old 07-29-2009, 09:28 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Hello rdhanek

Have a look at awk and sed; they would be good tools for that. The man pages aren't great for learning from so here are some links http://www.grymoire.com/Unix/Awk.html, http://www.gnu.org/software/gawk/manual/gawk.html, http://www.grymoire.com/Unix/Sed.html

Best

Charles
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
setting file permissions for file /var/log/Xorg.0.log mfb Linux - Security 1 07-07-2009 01:41 PM
"Unknown keyword in config file" when trying to boot from CD jkh107 Fedora - Installation 7 03-26-2009 12:29 AM
Firewall log file, how to make several different log files with IPTables? newtovanilla Linux - Newbie 5 11-28-2008 12:39 PM
how to grep a "keyword" beside another keyword? xiawinter Linux - Software 7 12-29-2007 12:50 AM
any ideas to reduce log file size or make log file size managed? George2 Programming 2 08-13-2006 06:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration