LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-17-2011, 08:45 AM   #1
Sampaio
LQ Newbie
 
Registered: Jan 2011
Posts: 2

Rep: Reputation: 0
Combine complicate files


Hi,

I would like to combine several txt files. I want to append after each line the name of the file and the information that is before "--" in the text file.

The information before "--" is the name of the analyzed group and from each of this group I need to extract the collumns DIST,CHR, BP and P.

Bellow is a short example of one file:

--begin of the file--

7A5 -- chr7:20090803..20273538 ( 182.735kb ) including 50kb border

DIST CHR SNP BP NMISS BETA SE R2 T P
92.92kb 7 rs10233571 20233727 1259 0.08996 0.04159 0.003708 2.163 0.03073


A1CF -- chr10:52186330..52365441 ( 179.111kb ) including 50kb border

DIST CHR SNP BP NMISS BETA SE R2 T P
-41.54kb 10 rs56058931 52194789 1257 -0.1114 0.04468 0.004926 -2.492 0.01282
46.34kb 10 rs12769066 52282668 1264 0.07943 0.03885 0.003302 2.045 0.04109
67.14kb 10 rs4317935 52303465 1265 0.08394 0.03877 0.003698 2.165 0.03057


--end of the file--

I hope you can help me.

Thanks in advance!!!
 
Old 01-17-2011, 09:26 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,999

Rep: Reputation: 3190Reputation: 3190Reputation: 3190Reputation: 3190Reputation: 3190Reputation: 3190Reputation: 3190Reputation: 3190Reputation: 3190Reputation: 3190Reputation: 3190
So what have you tried so far?
 
Old 01-19-2011, 05:50 AM   #3
Sampaio
LQ Newbie
 
Registered: Jan 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Dear Grail,

Thanks for your help. I decided to use perl and test another program with a more friendly output.

See you next time!
 
  


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] Combine 3 text files into 1 W_Bosman Linux - Newbie 7 09-01-2010 05:28 PM
combine two files Syed Tarique Moin Programming 16 07-05-2010 11:30 AM
Using GAWK to combine files paragkalra Programming 4 11-14-2009 07:43 AM
combine shadow files packets Linux - Newbie 2 04-18-2008 05:14 AM
Best way to combine files? JockVSJock Programming 4 04-25-2004 07:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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