Edit 'Text output' and copy the text into a new panel

Hi everyone, think i got a quite complext question:

I have got an output text from a plug-in node. I would like to change every ‘SNO 1’ to another number. For example ‘SNO 2’ or ‘SNO 54’. I would also like to have a new panel of this edited text. The best scenario is where i have a beginning node where i want 50 copy’s. This creates 50 text panels containing the same text but only all ‘SNO X’ are ‘SNO 1’ to ‘SNO 50’.

Thanks in advance. A solution on this would help me very much

The text in the output panel is:

+PROG SOFIMSHC
HEAD
PAGE UNII 0
SYST 3D GDIR NEGZ GDIV -1000
CTRL TOLG 0.010000
CTRL MESH 1
CTRL HMIN -

SLN 10 GRP 1 SNO 1 DRX 0.000000 0.000000 -1.000000 STYP B SDIV 1 FIMA ‘N’ FIME ‘N’
SLNB X1 18.93011126 8.01159404 0.00000000 X2 18.05347848 -8.96578841 0.00000000
SLN 11 GRP 1 SNO 1 DRX 0.000000 0.000000 -1.000000 STYP B SDIV 1 FIMA ‘N’ FIME ‘N’
SLNB X1 40.45630800 6.26394333 0.00000000 X2 38.58282057 -10.63250733 0.00000000
SLN 12 GRP 1 SNO 1 DRX 0.000000 0.000000 -1.000000 STYP B SDIV 1 FIMA ‘N’ FIME ‘N’
SLNB X1 60.53028191 3.47526147 0.00000000 X2 57.72719068 -13.29204837 0.00000000
SLN 13 GRP 1 SNO 1 DRX 0.000000 0.000000 -1.000000 STYP B SDIV 1 FIMA ‘N’ FIME ‘N’
SLNB X1 77.32040449 0.26482838 0.00000000 X2 73.73978102 -16.35380982 0.00000000
SLN 14 GRP 1 SNO 1 DRX 0.000000 0.000000 -1.000000 STYP B SDIV 1 FIMA ‘N’ FIME ‘N’
SLNB X1 104.48836942 -6.68439839 0.00000000 X2 99.64962717 -22.98122549 0.00000000

END

+PROG AQUA
HEAD
INTE 0
END

Hello sailor!

Done!

Here’s the script find_and_replace.gh (13.2 KB)

Best regards,
Sir Ernest Shackleton


if this answer solves your problem, please mark it as solved.

1 Like

Thank you. Did not know there was a ‘Replace text’ node.