Received: by 10.90.100.20 with SMTP id x20mr353793agb.27.1242426604919; Fri, 15 May 2009 15:30:04 -0700 (PDT)Date: Fri, 15 May 2009 15:30:04 -0700 (PDT)X-IP: 131.239.49.21User-Agent: G2/1.0X-Google-Token: aVsDfgwAAAByAHVlJtpKo6Mf8G_REZkiX-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6; .NET CLR 1.1.4322; InfoPath.1; MS-RTC LM 8; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729),gzip(gfe),gzip(gfe)Message-ID: <95b76b55-716f-4d3a-b914-2cbd323e3c02@q14g2000vbn.googlegroups.com>Subject: Search string/extract part of stringFrom: “agarwalprasun@gmail.com” To: “Kdb+ Personal Developers” X-Google-Approved: simon.garland@gmail.com via web at 2009-05-18 07:17:34Hi,I am new to q. Have a column in table called programid which has text"MRI06:02SEP200881369Y30". I want to create three new columns thefirst containing MRI06 (from start of string to “:”), second columnwith the date (02Sep2008), and the third column with the remainingpart.I couldnt find a function that helps extract part of strings. Hassomeone dealt with this before? If so can you help?ThanksPrasun
?0 6 15 _ “MRI06:02SEP200881369Y30”
q)(“SD*”;6 9 8)0:enlist “MRI06:02SEP200881369Y30”
MRI06:
2008.09.02
“81369Y30”
q)
skip the enlist if you’re giving it a list of values