Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DF65211CA8 for ; Wed, 21 May 2014 10:08:12 +0000 (UTC) Received: (qmail 37184 invoked by uid 500); 21 May 2014 10:08:09 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 37035 invoked by uid 500); 21 May 2014 10:08:08 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 37028 invoked by uid 99); 21 May 2014 10:08:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 May 2014 10:08:08 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sshi@gopivotal.com designates 209.85.192.52 as permitted sender) Received: from [209.85.192.52] (HELO mail-qg0-f52.google.com) (209.85.192.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 May 2014 10:08:04 +0000 Received: by mail-qg0-f52.google.com with SMTP id a108so2739320qge.25 for ; Wed, 21 May 2014 03:07:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=HWkcLZkaYLeTre3BWZp1YbtR/1UyYCsXJ4+++u8rv90=; b=FKRfzoODBzgv/IadS0tHdObcXQ9gFwo8x5A/JFAzM2pNUQ66RjscXBdxIrCI9eAgUf 6wbgGKryZtNVllBkg0TNi2u+YjSf/SrTRK1Y29RJqgvYl8P4Ua5eczRtaHbPQX0WZrlg CVWLoH5CkpwJEJD2gDFujonUvkFxSBG93eupAl8CHge3aoeOzQqRaj7zMZzq4J/ASB0+ MOzj2Ez76bt2Z0Tit/vIE1pPgoctTn92t21mFt2HklxUYuQ0OoKhQ/p/wvdYRmhQ6MqJ Yo+5Bwo2LqLAt0CGfz5XNGsLCdJ4K/pbiksnDkP44urk2fVxtR2aqBGTsdqPvitl+8E7 7bIA== X-Gm-Message-State: ALoCoQlxFgVmFCKWU4Okel6Kty/K1dNxp8/T47/JCLWBvhyvs19ZTgROWt8floNU3kK9sViJnmNa MIME-Version: 1.0 X-Received: by 10.229.171.193 with SMTP id i1mr58191757qcz.15.1400666863659; Wed, 21 May 2014 03:07:43 -0700 (PDT) Received: by 10.140.94.146 with HTTP; Wed, 21 May 2014 03:07:43 -0700 (PDT) In-Reply-To: References: Date: Wed, 21 May 2014 18:07:43 +0800 Message-ID: Subject: Re: Issue with conf.set and conf.get method From: Stanley Shi To: "user@hadoop.apache.org" Content-Type: multipart/alternative; boundary=001a11c30668db743c04f9e62a05 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c30668db743c04f9e62a05 Content-Type: text/plain; charset=UTF-8 Are you trying to pass arguments from user input? reading input from stdin? I suggest you use some special characters to express; for example, let args[2] == "TAB" and in your program, you can convert this "TAB" to the real delimeter you want to use ("\t") Regards, *Stanley Shi,* On Wed, May 21, 2014 at 3:33 PM, unmesha sreeveni wrote: > > Hi, > > I am having an issue with conf.set and conf.get method > Driver > Configuration conf=new Configuration(); > conf.set("delimiter",args[2]); //File delimiter as user argument > > Map/Reduce > Configuration conf = context.getConfiguration(); > String delim = conf.get("delimiter"); > > All things works fine with this.I am able to get the delimiter("," ";" > .....) and process accordingly except "TAB" > > If I give > 1. \t as an argument it wont work any operations > eg: will not be able to do > 1. StringTokenizer st = new StringTokenizer(value.toString,delim) > > > 2. String classLabel = > value.toString.substring(value.toString.lastIndexOf(delim)+1); > > 2. "\t" as argument also wont work > 3. \\t and "\\t" also wont work > 4. " " this WORKS FINE as an argument. > > Anybody came across with this issue? > If so can any one tell me a workaround. > > Regards > Unmesha > > -- > *Thanks & Regards * > > > *Unmesha Sreeveni U.B* > *Hadoop, Bigdata Developer* > *Center for Cyber Security | Amrita Vishwa Vidyapeetham* > http://www.unmeshasreeveni.blogspot.in/ > > > --001a11c30668db743c04f9e62a05 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Are you trying to pass arguments from user input? rea= ding input from stdin?

I suggest you use some special characte= rs to express; for example, let args[2] =3D=3D "TAB" and in your = program, you can convert this "TAB" to the real delimeter you wan= t to use ("\t")

Regards,
Stanley Shi,



On Wed, May 21, 2014 at 3:33 PM, unmesha= sreeveni <unmeshabiju@gmail.com> wrote:

Hi,

I am having an issue with conf.set and conf.get= method
Driver
Configurati= on conf=3Dnew Configuration();
conf.set("delimiter",args[2]); = =C2=A0 =C2=A0 =C2=A0 //File delimiter as user argument

=
Map/R= educe
Configuration conf =3D context.getConfiguration();
String deli= m =3D conf.get("delimiter");

All things works fine with this.I am abl= e to get the delimiter("," ";" .....) and process accor= dingly except "TAB"

1. \t as an argument it wont work any operations=C2=A0
=C2=A0 =C2=A0eg: will not be able to do= =C2=A0
=C2=A0 =C2=A0 =C2=A01. StringTokenizer st =3D new StringTokenizer(v= alue.toString,delim)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 <but works for split>
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <String[] parts =3D value.toSt= ring.split(delim);>
=C2=A0 =C2= =A0 =C2=A02. String classLabel =3D value.toString.substring(value.toString.= lastIndexOf(delim)+1);

3. \\t and "\\t" = also wont work
4. " " this WORKS FINE as an arg= ument.

If so can any one tell me a workaro= und.

=
Regar= ds
Unmesha
--
Thanks & R= egards

Unmesha Sreeveni U.B
Hadoop, Bigdata Developer
=
Center for Cyber Security | Amrita Vishwa Vidyap= eetham


<= /div>

--001a11c30668db743c04f9e62a05--