You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by praveenesh kumar <pr...@gmail.com> on 2012/02/01 10:58:03 UTC
How to convert sequence file into normal text file
I am running SimpleKmeansClustering sample code from mahout in action. How
can I convert sequence file written using SequenceFile.Writer into plain
HDFS file so that I can read it properly. I know mahout has seqdumper tool
to read it. But I want to create normal text file rather than sequence file
as output. Can anyone tell me how to do it inside the code.
ITs kind of urgent. Please help.
Thanks,
Praveenesh
Re: How to convert sequence file into normal text file
Posted by praveenesh kumar <pr...@gmail.com>.
Cool.
I used the 2nd method. Will look out for other 2 also.
Thanks,
Praveenesh
On Wed, Feb 1, 2012 at 4:43 PM, Harsh J <ha...@cloudera.com> wrote:
> Praveenesh,
>
> The utility "hadoop fs -text <seqfile>", documented at
> http://hadoop.apache.org/common/docs/current/file_system_shell.html#text
> can read SequenceFiles and print their string representations out.
> Will this be of any help?
>
> Otherwise, you want to use a SequenceFile.Reader over your given file
> and after reading each record out, store them in their text
> representation with a regular file writer. An even easier way may be
> an identity job with sequence-file input format and text output
> format.
>
> On Wed, Feb 1, 2012 at 3:28 PM, praveenesh kumar <pr...@gmail.com>
> wrote:
> > I am running SimpleKmeansClustering sample code from mahout in action.
> How
> > can I convert sequence file written using SequenceFile.Writer into plain
> > HDFS file so that I can read it properly. I know mahout has seqdumper
> tool
> > to read it. But I want to create normal text file rather than sequence
> file
> > as output. Can anyone tell me how to do it inside the code.
> > ITs kind of urgent. Please help.
> >
> > Thanks,
> > Praveenesh
>
>
>
> --
> Harsh J
> Customer Ops. Engineer
> Cloudera | http://tiny.cloudera.com/about
>
Re: How to convert sequence file into normal text file
Posted by Harsh J <ha...@cloudera.com>.
Praveenesh,
The utility "hadoop fs -text <seqfile>", documented at
http://hadoop.apache.org/common/docs/current/file_system_shell.html#text
can read SequenceFiles and print their string representations out.
Will this be of any help?
Otherwise, you want to use a SequenceFile.Reader over your given file
and after reading each record out, store them in their text
representation with a regular file writer. An even easier way may be
an identity job with sequence-file input format and text output
format.
On Wed, Feb 1, 2012 at 3:28 PM, praveenesh kumar <pr...@gmail.com> wrote:
> I am running SimpleKmeansClustering sample code from mahout in action. How
> can I convert sequence file written using SequenceFile.Writer into plain
> HDFS file so that I can read it properly. I know mahout has seqdumper tool
> to read it. But I want to create normal text file rather than sequence file
> as output. Can anyone tell me how to do it inside the code.
> ITs kind of urgent. Please help.
>
> Thanks,
> Praveenesh
--
Harsh J
Customer Ops. Engineer
Cloudera | http://tiny.cloudera.com/about
Re: How to convert sequence file into normal text file
Posted by Harsh J <ha...@cloudera.com>.
Praveenesh,
The utility "hadoop fs -text <seqfile>", documented at
http://hadoop.apache.org/common/docs/current/file_system_shell.html#text
can read SequenceFiles and print their string representations out.
Will this be of any help?
Otherwise, you want to use a SequenceFile.Reader over your given file
and after reading each record out, store them in their text
representation with a regular file writer. An even easier way may be
an identity job with sequence-file input format and text output
format.
On Wed, Feb 1, 2012 at 3:28 PM, praveenesh kumar <pr...@gmail.com> wrote:
> I am running SimpleKmeansClustering sample code from mahout in action. How
> can I convert sequence file written using SequenceFile.Writer into plain
> HDFS file so that I can read it properly. I know mahout has seqdumper tool
> to read it. But I want to create normal text file rather than sequence file
> as output. Can anyone tell me how to do it inside the code.
> ITs kind of urgent. Please help.
>
> Thanks,
> Praveenesh
--
Harsh J
Customer Ops. Engineer
Cloudera | http://tiny.cloudera.com/about