Thread: Output Columns form a file

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    82

    Output Columns form a file

    Hi,

    I was wondering if someone could help me. Long ago i had a useful perl file that would let you output columns from a file into another text file that contained what you needed.

    Basically i want to just output column number two from the example below so i can input it into spss/minitab etc.

    0 0.423334
    1 0.424167
    2 0.424167
    3 0.424584
    4 0.425000
    5 0.427500
    6 0.427500
    7 0.427084
    8 0.428750
    9 0.429167

    Is there an easier way around this, no doubt unaware to me. any help is greatly appreciated

    Regards Wolfe

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Code:
    awk '{print $2}' infile > outfile
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    82
    Ahh that the one, thank you very much.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM
  3. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 03:58 PM
  4. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM
  5. Simple File Creation Algorithm
    By muffin in forum C Programming
    Replies: 13
    Last Post: 08-24-2001, 03:28 PM