Help ! Copier/Coller avancé avec Script & regex

62 views
Skip to first unread message

anne marie Gay

unread,
Oct 15, 2021, 10:01:06 AM10/15/21
to Google Apps Script Community
Bonjour la communauté !

Connaissez vous un moyen pour faire un copier/coller du type
Je possède une ligne saisie dans un fiche google Contact (que je Copie)
A + B + C + X
Je désire obtenir dans un Google Document après un Coller
A
B
C
X
à vos cahier !
Je pensais à un script avec un regex pour traiter la chaine le remplacement des "+" par des saut de Lignes

Merci d'avance

============
Hello community!

Do you know a way to copy / paste like
I have a line entered in a google Contact file (which I copy)
A + B + C + X
I want to get in a Google Document after a Paste
TO
B
VS
X
to your notebooks!
I was thinking of a script with a regex to process the string replacing the "+" by line breaks

thanks in advance

anne marie Gay

unread,
Oct 16, 2021, 5:53:47 AM10/16/21
to Google Apps Script Community
Thanks to
un essai avec Gsheet

Capture d’écran 2021-10-16 à 11.50.53.png
Laurent Collet
Author
Thank you Philippe Roy, It works very well with Gsheet, my concern is to link it to a Google Document (word processor) for a gain in productivity. Can be a box to click (or CTRL V in a Google Text Document (Sidebar for example) which would execute the script of the spreadsheet in the background to at the end return the final result to the position of the Cursor. What do you think?

Emeric HOCHART

unread,
Oct 18, 2021, 1:22:20 AM10/18/21
to Google Apps Script Community
const p = "A + B + C + X"; 

const t = p.replaceAll('+', '\n');

anne marie Gay

unread,
Oct 19, 2021, 3:10:52 AM10/19/21
to Google Apps Script Community
Merci @Emeric HOCHART
Je ne voit pas parcontre la solution pour aborder le script 
Reply all
Reply to author
Forward
0 new messages