I have a list of data that I need to put a '
symbol at the start of the line and at the end of the line. So the original data looks like
abcde
cdeab
deabc
eabcd
And I want all the line to look like
'abcde'
'cdeab'
'deabc'
'eabcd'
In my real data, I would have 10,000 of lines. So if I can do something like Ctrl+Shift+A to select the entire document and then have some magic shortcut to change from selecting all lines to editing all lines that would be perfect!
You could edit and replace with a regex:
Find (Ctrl+F):
^(.+)$
Replace:
'$1'
This regex finds any content on a line and inserts it inside quotes. Be sure to tick the regex icon.
If every line might have a space before the content, try this:
Find:
^ ?(.+)$
Replace:
'$1'
You can use the Alt + Shift shortcut.
First press Alt + Shift then click the mouse button on the first line.
Go to the last line, and then do the same.
This will mark all the parts of one side. Whatever you type will be reflected in the marked spaces.
Do the same on the other side too.
Use Toggle Multi curosr Modified
from action pane.
Select the cursor points with ctrl
+ <Mouse click>
, you can modify everything simultaneously.
This will require lots of manual efforts if lines are more
You can use Find and Replace.
Besides, paste to Excel and using a function to add character '
.
The first thing that came to my mind - replace abcde
with 'abcde'
line by using option Find and Replace
option. I'm pretty sure Visual Studio Code has something similar to that.
1- You can use the Ctrl + H shortcut (menu Edit → Replace)
Enter abcde in Find Control.
Enter 'abcde' in Replace Control.
Then press Ctrl + Alt + Enter.