Friday, September 9, 2022

Re: Print the first field of a table in one line separated by commas

On Tue, Sep 06, 2022 at 10:43:50PM +0000, Tim Chase wrote:
> On 2022-09-06 14:45, andalou wrote:
> > I have the table:
> > 1001 john sena 40000
> > 1002 jafar iqbal 60000
> > 1003 meher nigar 30000
> > 1004 jonny liver 70000
> > I'd like to print the first field, preceded by xx, and followed by yyy,
> > separated by commas, as in:
> > xx1001yyy, xx1002yyy, xx1003yyy, xx1004yyy

I'll use

:%!sed 's/ .*/yyy,/'|tr '\n' ' '

regards
--
Marc Chantreux
Pôle de Calcul et Services Avancés à la Recherche (CESAR)
http://annuaire.unistra.fr/p/20200

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/YxuhTgV%2BXr2Dlmm9%40prometheus.u-strasbg.fr.

No comments: