question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Operation request: Prepend/append text

See original GitHub issue

Summary

Especially when using the fork or the subsection operation, it would be useful to be able to

  1. Extract relevant parts
  2. Modify them
  3. Wrap them in surrounding text

The last step here is rather clunky at the moment, since it involves having to whip out find and replace regex which simply match everything

Up to step 2 image

Current workaround for step 3, notice how the regex is quite odd since .* doesn’t work as expected.

image

Example

https://gchq.github.io/CyberChef/#recipe=Subsection(’ \\d%2B’,true,true,false)Find_/_Replace({‘option’:‘Regex’,‘string’:‘(\\d%2B)’},‘$1 1’,true,false,true,false)Sum(‘Space’)Find_/_Replace({‘option’:‘Regex’,‘string’:‘[^]%2B’},’ $%26’,true,false,true,true)&input=bWVzc2FnZSBHYW1lQWN0aW9uIHsKICAgIG9uZW9mIGFjdGlvbiB7CiAgICAgICAgQ2xpZW50UGxheWVyTW92ZSB1aW50MzIgY19wbGF5ZXJfbW92ZSA9IDA7CiAgICAgICAgU2VydmVyUGxheWVyTW92ZSBzX3BsYXllcl9tb3ZlID0gMTsKCiAgICAgICAgQ2xpZW50UGxheWVyVXBkYXRlIGNfcGxheWVyX3VwZGF0ZSA9IDI7CiAgICAgICAgU2VydmVyUGxheWVyVXBkYXRlIHNfcGxheWVyX3VwZGF0ZSA9IDM7CiAgICB9Cn0

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
n1073645commented, Jul 27, 2022

The only issue when using Pad Lines in that fashion is that you have to make sure that the Length field matches (or is a multiple of) the Length of the Characters you want to repeat otherwise there will be partial repetitions. This functionality is useful so it will not be removed, it will instead be documented in the operation’s description.

I think that the operation’s argument name should be changed to “Character(s)” as it will still be valid to put a single character in there or several characters.

0reactions
stefnotchcommented, Jul 27, 2022

Sounds good 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

append and prepend text to a string - php - Stack Overflow
but I would have to write "cats" twice. I want a method that only requires me to write it once. php · regex...
Read more >
BASH Prepend A Text / Lines To a File - nixCraft
Use sed command to prepend data to a text file​​ Here is a sample input file: $ cat input.
Read more >
Document.prepend() - Web APIs - MDN Web Docs
The Document.prepend() method inserts a set of Node objects or string objects before the first child of the document.
Read more >
Support append/prepend operations for trigger parameters #315
I'm down to author a pull request if that's helpful but I thought I'd ask first to judge how it might be received....
Read more >
Append or Prepend to a Text or Binary File in LabVIEW - NI
The file already has pre-allocated memory space so for a prepend to occur all the existing data would need to be shifted down...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found