copy column from file to be the first column in another file

8 views
Skip to first unread message

A G

unread,
Jun 25, 2019, 6:32:59 AM6/25/19
to Linux Users Group
Hello,

I want to copy a column from file to be the first column in another file contains many columns. How can I do that using the command line?

file 1 as
1
2
2
-
-
file 2 as

2  5
3  5
3  5
-  -
-  -

I want fil3 as 

1 2  5
2 3  5
2 3  5
- -  -
- -  -


John E1

unread,
Jun 27, 2019, 7:13:22 AM6/27/19
to linuxus...@googlegroups.com
it’s been years since I’ve done stuff like this, but the tool I’d probably use is OWL. Others may suggest PERL or SED. If you google how to merge columns of text using OWL, you might find exactly what you’re looking for.

Hope that helps.


--
--
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to linuxus...@googlegroups.com
To unsubscribe, send email to linuxusersgro...@googlegroups.com
For more options, visit our group at http://groups.google.com/group/linuxusersgroup
References can be found at: http://goo.gl/anqri
Please remember to abide by our list rules (http://tinyurl.com/LUG-Rules)
---
You received this message because you are subscribed to the Google Groups "Linux Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linuxusersgro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linuxusersgroup/eb397135-dac2-4bbb-8107-464e2ffd71c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages