Path: csiph.com!weretis.net!feeder8.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Karl Ratzsch Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Filepath column data: basename Date: Sat, 21 Nov 2020 10:35:52 +0100 Organization: solani.org Message-ID: References: <2f8a72a5-b4c1-40d4-ae13-8634463cd5bcn@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 21 Nov 2020 09:35:56 -0000 (UTC) Injection-Info: solani.org; logging-data="13854"; mail-complaints-to="abuse@news.solani.org" User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 In-Reply-To: <2f8a72a5-b4c1-40d4-ae13-8634463cd5bcn@googlegroups.com> Cancel-Lock: sha1:xU3gmLdQwuNM5C74ZbJRNK4f1EU= X-User-ID: eJwFwQkBwDAIA0BLfAkgp3TDv4Tewam8GQQDi2V9xpqMdqtIhxQscU+sKuefyUaX7HHx9X34jBAl Content-Language: de-DE Xref: csiph.com comp.graphics.apps.gnuplot:4374 Am 21.11.2020 um 01:18 schrieb Sarat Sreepathi: > Hello: > > I have a data file where one of the columns contains full path names. Is there a trick to getting a basename from that field? Any builtins for other transformations on that field? > > Appreciate any pointers. > Thanks, > Sarat. > Recursion: ;) basen(fullp) = (a = strstrt(fullp,'\'), a == 0 ? fullp : basen( substr(fullp,a+1,strlen(fullp) ) ) ) pr basen('helo') pr basen('helo\halo') pr basen('helo\halo\holo') In the same way you can delete (possibly multiple) .extensions from the filename.