LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-27-2007, 10:49 AM   #1
anhtt
LQ Newbie
 
Registered: Jul 2007
Posts: 27

Rep: Reputation: 15
Awk Helps


I have a input file, for example
960123648;350200100
960254639;350200111
..

Now I want to change 350200100 to 3503200100
350200111 to 3503200111
..

How to do this with AWK
 
Old 07-27-2007, 11:48 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If you need to use 'awk' to solve this, then maybe this is another homework question?
 
Old 07-28-2007, 03:52 PM   #3
cfaj
Member
 
Registered: Dec 2003
Location: Toronto, Canada
Distribution: Mint, Mandriva
Posts: 221

Rep: Reputation: 31
Quote:
Originally Posted by anhtt
I have a input file, for example
960123648;350200100
960254639;350200111
..

Now I want to change 350200100 to 3503200100
350200111 to 3503200111
..

How to do this with AWK

Code:
awl '{ sub( "3502", "3503" ) } { print }' FILENAME
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cronjob helps gsrichmo Linux - General 7 11-29-2005 12:54 PM
www helps conm Linux - Software 1 07-08-2005 09:14 PM
Ubuntu helps whiteFang Ubuntu 1 03-31-2005 05:39 PM
Another problem with mouse (on 2.6.11) - nothing helps bendi Slackware 6 03-09-2005 01:36 PM
X-windows helps on mandrake 8.0! newguy2001 Linux - Newbie 0 05-17-2001 11:44 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:07 PM.

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