Received: by 10.100.216.12 with SMTP id o12mr122018ang.27.1236238769981; Wed, 04 Mar 2009 23:39:29 -0800 (PST)Date: Wed, 4 Mar 2009 23:39:29 -0800 (PST)X-IP: 221.223.74.134User-Agent: G2/1.0X-Google-Token: Kprb3gwAAAAApLZjCBLZAsw1OktPz3giX-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.48 Safari/525.19,gzip(gfe),gzip(gfe)Message-ID: <5c245cbb-ff09-49bb-861d-96f40356833c@r10g2000prf.googlegroups.com>Subject: How to rename the column name of a table according to a variableFrom: Wind To: “Kdb+ Personal Developers” X-Google-Approved: charlie@kx.com via web at 2009-03-05 08:09:28We could change col names with xcol:q)cols bsym
datecloseq)b:
symdate
ibm.close xcol bq)cols bsym
dateibm.closeThe questions are as following:1. could we change the col names according to a variable? such as :q)x:
GOOGq)sym
date`$(string x) xcol b’nyi2. whether xcol is the efficient method changing name of columns.Thanks.
yes
q)(sym
date,`$string x) xcol b
xcol is very efficient
Date: Thu, 5 Mar 2009 08:35:13 +0000Message-ID: <1855e77f0903050035h6c0f893ch88644f21b76840b4@mail.gmail.com>Subject: Re: [personal kdb+] Re: How to rename the column name of a table according to a variableFrom: Attila Vrabecz <attila.vrabecz>To: personal-kdbplus@googlegroups.com(sym
date,x) xcol bis enough if x is already a symbol AttilaOn Thu, Mar 5, 2009 at 8:18 AM, Charlie Skelton,Kx wrote:> yes> q)(sym
date,$string x) xcol b>> xcol is very efficient> On Thu, Mar 5, 2009 at 8:39 AM, Wind <windspeedo99> wrote:>>>> We could change col names with xcol:>> q)cols b>>
symdate
close>> q)b:sym
dateibm.close xcol b>> q)cols b>>
symdate
ibm.close>>>> The questions are as following:>> 1. could we change the col names according to a variable? ?such as :>> q)x:GOOG>> q)
symdate
$(string x) xcol b>> 'nyi>>>> 2. whether xcol is the efficient method changing name of columns.>>>> Thanks.>>>>>>>>> >></attila.vrabecz>
Great. That works well.Thanks AttilaWindOn Mar 5, 4:35?pm, Attila Vrabecz <attila.vrab…> wrote:> (sym
date,x) xcol b> is enough if x is already a symbol> ? Attila>> On Thu, Mar 5, 2009 at 8:18 AM, Charlie Skelton,Kx <char…> wrote:> > yes> > q)(sym
date,$string x) xcol b>> > xcol is very efficient> > On Thu, Mar 5, 2009 at 8:39 AM, Wind <windspeed...> wrote:>> >> We could change col names with xcol:> >> q)cols b> >>
symdate
close> >> q)b:sym
dateibm.close xcol b> >> q)cols b> >>
symdate
ibm.close>> >> The questions are as following:> >> 1. could we change the col names according to a variable? ?such as :> >> q)x:GOOG> >> q)
symdate
$(string x) xcol b> >> 'nyi>> >> 2. whether xcol is the efficient method changing name of columns.>> >> Thanks.</windspeed…></char…></attila.vrab…>