LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-25-2012, 11:28 AM   #1
hjorge_2001
LQ Newbie
 
Registered: Apr 2012
Posts: 1

Rep: Reputation: Disabled
Programming in AWK


Hi everybody,

I'm new in AWK programer. So i need help for this: I need to trasnformer this text below in one line.

----------------------------------------------------
1002965811
1002965811 HENRIQUE SOUZA SILVA
002965811 R RIO VERDE
002965811 NOVO AGUA LIMP
002965811 999.899.222-33
+002965811 4.0129.0001.088-9
2002965813 073
002965813 096
002965813 06,0000
002965813 1,22200
002965813 1,00000
002965813
002965813
002965813 MF02S
002965813 094 / 025
002965813 310
002965813 0129-5

transform in one line like this:
--------------------------------------------------
HENRIQUE SOUZA SILVA 99989922233 4012900010889 01295

Thank you
 
Old 04-25-2012, 11:49 AM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
Look at the 'tr' command not awk for this.

Pipe your output to this:

Code:
tr '\n' ' '
If \n doesn't work try \r.

Last edited by colucix; 04-25-2012 at 12:34 PM. Reason: Fixed CODE tags
 
Old 04-25-2012, 12:12 PM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,243

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
How about you tell us how the data in the output is related? Otherwise we will assume that there is no reason and simply extract lines based on there position in the file, ie. line 2, 5, 6, 17
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] The AWK programming Language huaihaizi3 Programming 4 03-22-2011 11:04 AM
[SOLVED] Help in using 'awk' programming........ apanimesh061 Programming 8 11-21-2010 10:06 AM
Using wildcard in awk programming, how ? sarajevo Programming 2 10-18-2006 08:06 AM


All times are GMT -5. The time now is 05:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration