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 07-28-2014, 07:17 PM   #1
Almaz
Member
 
Registered: Jul 2013
Posts: 35

Rep: Reputation: Disabled
Combine 2 text files into 1.


I need to combine 2 text files into 1.

File1:
12345a

File2:
b6789 c

Output:
12345ab6789 c

Everything I tried makes a new line or creates a tab between them.

Last edited by Almaz; 07-28-2014 at 07:23 PM.
 
Old 07-28-2014, 07:31 PM   #2
Almaz
Member
 
Registered: Jul 2013
Posts: 35

Original Poster
Rep: Reputation: Disabled
hmmm since I can't delete my post. I found the answer to my own question

Code:
paste -d "" file1 file2 > file3
 
Old 07-29-2014, 06:55 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,258

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Alternately
Code:
 cat t1.t t2.t  |tr -d '\n' >t3.t
 
  


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
Combine multiple text files into one text file? dirtydog7655 Linux - Newbie 6 05-16-2013 11:47 PM
[SOLVED] Combine 3 text files into 1 W_Bosman Linux - Newbie 7 09-01-2010 06:28 PM
[SOLVED] Best way to combine and partially overwrite text files byron262 Linux - Software 2 05-18-2010 08:42 PM
combine text files with a regex itzfritz Linux - General 10 06-18-2009 02:26 PM
I need a program to combine text with gif files stephenoregan4 Linux - Software 1 02-16-2004 10:29 AM


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