Date: Fri, 11 Sep 2009 01:46:48 -0700
Reply-To: Amar Mundankar <amarmundankar@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Amar Mundankar <amarmundankar@GMAIL.COM>
Subject: Re: How to read only one column out of 10 columns in a file
Content-Type: text/plain; charset=ISO-8859-1
On Sep 11, 12:52 pm, Pobel <pobelgol...@gmail.com> wrote:
> On Sep 11, 2:33 pm, Amar Mundankar <amarmundan...@gmail.com> wrote:
> > Hi All,
> > There is a file "test.txt" which has the location as "c:\test.txt".
> > It contains 2 records. There are total 10 columns.
> > Now I want the value of only the 4 th column from that file without
> > reading the complete record. Consider all the columns as Character.
> > Data of the file "test.txt" is as follows.
> > aaaaa 22222 bbbbbb 33333 555555 8888 99999 444 ccccc 777777
> > ffffff 66666 111111 sssssss 2222222 hhhhhh gggggg kkkkkkk 9999999
> > rrrrrr
> > The output should be:
> > 33333
> > sssssss
> > Thanks in Advance.
> > Regards,
> > Amar.
> Try this:
> data test;
> infile "c:\test.txt";
> input @;
That solution worked perfectly for me.