LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

Joining records using sed or awk

Posted 07-01-2009 at 07:34 AM by JimRobinson
Tags awk, line join, sed

I have a very large file, 9 million records, and there are sections in the file where I need to join records. How can I get for example line number 100,000 and join to it lines 100,001-100,050 using sed or awk? The joins need to happen multiple times throughout the file. I can get the line number for the first and last line I need in my join but am having difficulty figuring out how to reformat the file with the lines joined and the file saved with the one end-resulting line.

Any...
LQ Newbie
Posted in Uncategorized
Views 2802 Comments 2 JimRobinson is offline

  



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

Main Menu
Advertisement
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