How to replace all tab characters in a file by sequences of white-spaces in intellij? - intellij-idea

Given a file in my project, I want to be able to replace all of the tab characters in the file with white spaces. Is there any way to do this in intellij?

Go to Edit | Convert Indents , and then choose To Spaces or To Tabs respectively. It's in the documentation: Changing identation

Replace only tabs used for indentation
Ctrl + Shift + A
type "To Spaces" > Enter
Replace all tabs
Ctrl + R
check Regex
Enter \t and spaces
Replace all

Related

Surround selection into array

I am aware about surrounding selection in quotes or braces
PhpStorm wrap/surround selection?
I need similar but surround selection into array
Assume I have text separated with newline or text separated with space
a
b
c
d
e
a b c d e
I need after selection get [a,b,c,d,e]
Please advice any IDE or method how to achieve this
A no-brainer solution
Make sure the following option is enabled:
For text separated with spaces:
Select the 'array-to-be', hit Ctrl+R and R again (to enter 'In selection' mode)
Type a space in the first field, , in the second
Click 'Replace all', hit Esc
With the text still selected, press [: the closing bracket will be added automatically
For multi-line text:
Select the 'array-to-be', hit Ctrl+R, enable 'Regex'
Type \n + in the first field, , in the second
Click 'Replace all', hit Esc
With the text still selected, press [: the closing bracket will be added automatically
The sequence of actions can be wrapped into a macro and assigned a single shortcut.
Vim + Surround plugin. Enter visual mode, select what you need and press S].
The first group could be created by:
:%s/\v(\w)(\n)*/\1,/g | exec "norm! I[\<Esc>A]"
It takes care of:
a
b
...
\v ........... very magic regex
() ........... regex group
(\w) ......... letters
(\n)* ........ zero or more line breaks
\1 ........... repeat content of the first regex group

How to remove all whitespace from a text file

I am trying to remove all whitespace using Intellij IDEA Ultimate 2019.1.2. I have a simple text file with json data.
I've tried using find and replace with regex enabled, but to no avail.
You can press the CTRL + R to open the replace panel, and enter a whitespace in the first input field, leave the second input field empty.
Then click the replace all button.
If you want remove all whitespace including line break, you can enter \s and enable the regex option.

How can I remove URL links from cells in openrefine?

How can I remove all URL in the text via openrefine? Is there any transform code for that? My data have many URL links different from each other in the texts. And I want to remove these links.
For example my data have like that text in the cells
"put returns between paragraphs for linebreak add 2 spaces at end italic or bold indent code by 4 spaces backtick escapes like _so_ quote by placing > at start of line to http://foo.com/"
And I want to delete only URL links in the cells. After removing it should be;
"put returns between paragraphs for linebreak add 2 spaces at end italic or bold indent code by 4 spaces backtick escapes like _so_ quote by placing > at start of line to"
This transformation should do the trick :
value.replace(/(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?/, '')

Add suffix after specific after some characters and after number of characters Notepad++

Id like to add .pdf text after
these characters: =pd
and after 6 characters behind characters above in Notepad++
for example:
for text:
=pd374069
=pd422552
add suffix:
=pd374069.pdf
=pd422552.pdf
Press ctrl+h or go into the find/replace window. Select Replace tab and choose the Regular Expression option.
In the find text box enter (=pd\d{6}(?!\d))
In the replace window enter \1\.pdf
It will transform
SPEC SHEET=pd374053;MANUAL=pd374069;SPEC SHEET=pd422552
into
SPEC SHEET=pd374053.pdf;MANUAL=pd374069.pdf;SPEC SHEET=pd422552.pdf

Select spaces on double-click in IntelliJ?

Is it possible to configure IntelliJ / WebStorm to select all spaces and tabs when I double-click on spaces in code, as many other editors do, rather than select the enclosing line or preceding word?
E.g. when I double-click the spaces between a and =:
a = 1;
AFAIK it is not possible in IntelliJ.As a workaround, you could select/mark a space and use the shortcut [Ctrl+Alt+Shift+J] to mark all spaces in code.
With [Alt+J] you can extend the selection of the spaces one by one.