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 08-04-2011, 07:55 AM   #1
bmn
LQ Newbie
 
Registered: May 2009
Posts: 20

Rep: Reputation: 0
new line after match


hi,
Code:
04.08.2011 4 00 5 35 12 48 16 34 19 49 21 16 12 24 05.08.2011 4 01 5 36 12 48 16 34 19 48 21 15 12 23  06.08.2011 4 02 5 37 12 48 16 33 19 47 21 14 12 23
how can i edit this line like that(using sed or awk):

Code:
04.08.2011 4 00 5 35 12 48 16 34 19 49 21 16 12 24
05.08.2011 4 01 5 36 12 48 16 34 19 48 21 15 12 23
06.08.2011 4 02 5 37 12 48 16 33 19 47 21 14 12 23
thank you.

Last edited by bmn; 08-04-2011 at 07:59 AM.
 
Old 08-04-2011, 08:05 AM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hi,

try this:
Code:
sed 's/[^[:blank:]]*\./\n&/2g'
Works with your sample data and GNU sed version 4.2.1.
 
1 members found this post helpful.
Old 08-04-2011, 02:19 PM   #3
bmn
LQ Newbie
 
Registered: May 2009
Posts: 20

Original Poster
Rep: Reputation: 0
thanks @crts it works..
 
  


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
match and combine 2 text files line by line Lowellj Linux - Newbie 9 03-21-2011 08:21 PM
Perl: Match part of a line and replace with another line from the same file briana.paige Linux - Newbie 8 06-27-2009 06:35 AM
Perl question: delete line from text file with duplicate match at beginning of line mrealty Programming 7 04-01-2009 06:46 PM
grep/sed/awk - find match, then match on next line gctaylor1 Programming 3 07-11-2007 08:55 AM
help me match this regex line (easy) JustinHoMi Programming 7 03-17-2002 01:43 AM

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

All times are GMT -5. The time now is 10:30 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