Find the answer to your Linux question:
Results 1 to 6 of 6
Hi everybody: Could anybody help how could I add columns to file that just exist, and the columns added came from other files? Thanks in advance....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! tonet's Avatar
    Join Date
    Mar 2005
    Location
    Girona, CAT
    Posts
    28

    Add columns to file from others


    Hi everybody:
    Could anybody help how could I add columns to file that just exist, and the columns added came from other files?
    Thanks in advance.

  2. #2
    Just Joined!
    Join Date
    Mar 2005
    Location
    South Africa
    Posts
    88
    Not too sure what you are getting at?
    What format are these files in? csv?
    And how do you want to add the columns: Bash script, in a gui...?

  3. #3
    Linux Enthusiast
    Join Date
    Jan 2005
    Posts
    575
    The paste command might be what you need.I've just noticed
    that the Linux man page is rather terse so you might want to look
    on the net for more info.There are non obvious things you can
    do with it.

  4. #4
    Just Joined! tonet's Avatar
    Join Date
    Mar 2005
    Location
    Girona, CAT
    Posts
    28
    hi:
    My question is. i've a file with one column, and i want to appernd new columns, and these new columns from other fiiles, it's possible do it with awk?.
    thanks in advance.
    Note: my files are .txt

  5. #5
    Just Joined!
    Join Date
    Apr 2005
    Posts
    25
    Check out the paste command. From what I can gather, the files you are getting the columns from can only have one column each. So, if you have two files, moreCol and addToMe

    Code:
    paste moreCol addToMe > addToMe
    would successfully add the one column from moreCol to addToMe. If moreCol has multiple columns, then the columns overwrite one another.

    Hopefully that helps.

  6. #6
    Linux Enthusiast
    Join Date
    Jan 2005
    Posts
    575
    Quote Originally Posted by tonet
    hi:
    My question is. i've a file with one column, and i want to appernd new columns, and these new columns from other fiiles, it's possible do it with awk?.
    Yes you can do it with awk.Use the getline command to read
    from multiple files simultaneously.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •