Append items of a list to each line in Notepad++ - regex

I have a list of items that looks like:
White
Green
Blue
Yellow
Black
I'd like to append each item above to these lines of text:
Line One:
Line Two:
Line Three:
Line Four:
Line Five:
So that the final outcome is:
Line One: White
Line Two: Green
Line Three: Blue
Line Four: Yellow
Line Five: Black
My actual list is a couple hundred lines long. Is there a way to do this in Notepad++ with regex?

Might be faster to paste the columns into any old spreadsheet and then copy it back to a text editor.

Related

Matching line where the line number is the sum of constants and the value of a certain line content (in a variable multiline text)

I have this file below, which is 3 recipes. Each recipe contains a fixed number of header lines and a variable number of ingredient lines (composition).
The last line of the header gives the number of the ingredients in the composition. This line is always the 16th line of the header (in the linked screenshot these are lines 16, 38, 58).
Then comes the composition with the number of lines as defined in line 16 of the header.
Then the last line of each recipe is always 0,
I need to separate the recipes, so I need to find the last lines, which are line 22, 42 68 in the example.
The number of lines for each recipe is:
16 lines of header + the number of the ingredients (integer defined in line 16 of the header + 1 line (the final 0,)
screenshot of the text
I only got this far:
(?:.*?^0\,){1}
https://regex101.com/r/js3leQ/1
But this only finds all the lines with 0,.
Actually it would be good to find once the third 0, line match.
That would already give me the solution I need (since the third 0, is always the last line of a recipe).
To identify the ending row (3rd zero), the following may work, if you were able to only have regex g flag (without m)
0,(?=\n"REC|$)
https://regex101.com/r/ufXYFU/1
Update. According to the comment that "1", always precedes the 0,, the following should probably work (it would work even if m flag was present):
(?<="1",\n)0,
https://regex101.com/r/aJk5zM/1

Markdown: continue text in list after a nested list

I need to insert a sub-list in a list and then continue the text in the item:
1. Start of the item text
- First item of sublist;
- Second item of sublist;
More text of the first item.
2. Second Item
3. Third item
The text after the nested list is not aligned correctly after rendering (should be aligned with "Start", is aligned with "1."). Any suggestion?
The text should be left-aligned with the text after the number, then the rendered text will be aligned to it.
Here is your example:
1. Start of the item text
- First item of sublist;
- Second item of sublist;
More text of the sublist of the first item.
The pending text of "More text of the sublist of the first item."
More text of the first item.
The pending text of "More text of the first item."
2. Second Item
3. Third item
The first line text have two chars: 1 . with one space before the text conent Start of...
Then the text you wants to aligned should also have 3 spaces before the text content of More text of...
Moreover, having <=N spaces (N presents the length of the prefix text of the list context, in this example, N=3) before the text content will make the content aligns with this list text
e.g.
Having 1 ~ 3 spaces will make the text aligns with the 1st line text, having 4 ~ 6 spaces will make the text aligns with the 2nd line text,

Extracting multiple lines of text between delimiters from a single cell

In Google Sheets or Excel, I would like to extract multiple lines of text between the delimiters x/ and / using a single formula.
INPUT:
x/Apple Juice/,Banana,Grape,x/Pear Juice/,Cherry,Orange,Blueberry
OUTPUT expected:
Apple Juice, Pear Juice
The input line of text may be longer or shorter and the position and instances of "x/text/" can vary.
=ARRAYFORMULA(TEXTJOIN(", ", 1, IFERROR(REGEXEXTRACT(SPLIT(A1, ","), "x/(.*)/"))))

Match and highlight two sets of columns in VIM

This SO post describes how to highlight all characters on a line in VIM past a given line number (80, in this case).
I'd like to have two sets of highlighted characters, columns 81-100 highlighted with one background color, and columns 101+ with another background color.
Here's what I've tried so far:
" Light highlight characters past column 80. Red highlight past 100.
highlight OverLength1 ctermbg=red ctermfg=white guibg=#5b4f62
match OverLength1 /\%81v.\+/
highlight OverLength2 ctermbg=red ctermfg=white guibg=#990500
match OverLength2 /\%101v.\+/
as well as this variation on the 3rd line:
match OverLength1 /\%81v.\+($|100v)/
Neither works. The best I can get is to match 101+ alone; it seems like the second match overwrites the first match.
I don't like the colorcolumn option, I don't want to highlight empty columns, just text in the ranges specified.
Try
" Light highlight characters past column 80. Red highlight past 100.
highlight OverLength1 ctermbg=red ctermfg=white guibg=#5b4f62
match OverLength1 /\%81v.\+/
highlight OverLength2 ctermbg=red ctermfg=white guibg=#990500
2match OverLength2 /\%101v.\+/
Read more about it on :h 2match.

Find line + 1 line after it

How to find line + one line after that?
Eg
I have the lines
123123
some text
546454
some text
354543
some text
465466
some text
123123
some text
So i know how to find 123123 (^123123) and other but how get +1 line with text 'some text'
result shoud be
123123
some text
123123
some text
Update
I forgot to say, after text can be other text 123123 is start of line
123123 text text text text text
some text
Sorry
You can use a new line between your pattern and related regex for next line :
/123123\n[^\d]+/g
Demo https://regex101.com/r/zA2cU6/1
Note that [^\d]+ will match any combination of characters which doesn't contains digit.(you can change it based on your need)
Update:
If you want to match the text after your pattern you just can add .* after it :
123123.*\n[^\d]+
Demo : https://regex101.com/r/zA2cU6/2