How to convert column to a row in notepad++ - formatting

How can I convert
testext
to
t
e
s
t
e
x
t
Please note there is no delimiter. Is there any way?

Go to Search → Find → Replace (Ctrl+F) and type following:
Find: (.)
Replace: $1\n
SearchMode: Regular Expression
Direction: Down
Then place the caret at the beginning of the text and hit "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.

LibreOffice - Replacing specific parts of a text line

I have a series of lines in LibreOffice/OpenOffice, formatted like so:
title(tab)data1(tab)data2(tab)data3
(tab) is an actual tab character.
What I would like to be able to do is:
prepend the line with "____ "
bold "title"
remove the first (tab), and surround data1 with brackets []
change the second (tab) to ": "
remove the third tab, and surround data3 with brackets []
The lines would hopefully end up as:
____ title [data1]: data2 [data3]
How can this happen?
Go to Edit -> Find and Replace:
Enter in the "Search For" box: ^([a-z0-9 ]+)\t([a-z0-9 ]+)\t([a-z0-9 ]+)\t([a-z0-9 ]+)$. Adjust this expression if the titles or data contain other characters such as punctuation. Documentation is here.
Enter in the "Replace With" box: ____ $1 [$2]: $3 [$4]
Expand "Other Options" and check Regular expressions.
Press Replace All to perform the replacement.
Then, bold the title as follows:
Search for: (?<=____)([a-z0-9 ]+) (?=\[)
Press the Find All button and close the dialog.
Now all the titles should be selected. Press the button in the toolbar to bold the text.

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

Autocapitalize sql keywords in notepad++

Is there a way to make notepad++ automatically make keywords uppercase? If no, then is there another text editor that does do this?
Highlight the words and press Ctrl + Shift + U
OR
Edit -> Convert Case To - UpperCase
PS: if you need to select a specific word and change it to uppercase in your whole document, you can always use 'Search n Replace'. For eg: Search for 'keyword', replace all with 'KEYWORD'.
see this answer regarding a Notepad++ plugin for formatting SQL
Poor Man's T-SQL Formatter
https://github.com/TaoK/PoorMansTSqlFormatter