RTF Numbered List Example - document

It seems impossible to find a very simple working example for an RTF numbered list that looks like this:
1. The first line
2. The second line
I tried to make a small sample by using Word but they produce a lot of garbage. Can anyone help out?
Somewhere I got this, but it's not working, only the first line is bulleted, more lines get appended to the first line.
\pard{\pntext\f0 1.\tab}\*\pn\pnlvlbody\pnf0\pnindent0\pnstart1\pndec{\pntxta.}}\fi-360\li480\sa50\sl0\slmult1 The first line
(My target is the RTF Edit box of Windows, so I'm not all concerned about backwards compatibility with older RTF readers like Word 6 which do not understand numbered lists and need fallback text formatted to look list numbers.)

The following works for me with the Windows RichTextBox control and Word version 1803:
{\rtf1
\pard{\pntext\f0 1.\tab}\*\pn\pnlvlbody\pnf0\pnindent0\pnstart1\pndec{\pntxta.}
\fi-360\li480\sa50\sl0\slmult1 The first line\par The second line\par The third line\par
\pard\par normal text
}
Inconsistencies come when you try to end the list without a blank line between the last list item and the normal text - Word displays it correctly, but the RTB control still shows "normal text" as part of the list (i.e. number 4.) if you remove the \par after \pard.

Related

Text with a dash in the cell but not in the formula bar (Excel)

In cell E1 it says You-Gov but in the formula bar it says YouGov.
If I copy/paste values it stays the same, the formatting is General. Using =CODE(MID($E$1,4,1)) I get a value of 173.
Any idea what is happening?
What you have got here is called the "Soft Hyphen". It's purpose is to let the system know where a word may be broken, if needed, for display purposes.
"The HTML standard states that a hyphen character should be displayed at the end of the line where the break occurs if a line is broken at a soft hyphen. On the other hand, nothing is displayed if the line is not broken at a soft hyphen."
And that is exactly what is happening in Excel. It may appear in-cell but the formula-bar will only show the Soft Hyphen when the word it's used in is actually broken in the editor itself. To test this out, try to squeeze Excel and it's formula bar to a very narrow pane. You'll notice the Soft Hyphen will appear on-and-off depending if it's needed to be shown. It's rather funny that MS even mentioned the Soft Hyphen in their docs but it won't show in the matrix, probably for the same reason.
To solve your issue:
Press Ctrl+F
Select 'Replace'
Search for: Hold Alt and type 0173 on the numpad.
Replace with: - A normal hyphen.
Here is a fun little demonstration from here full of "shy" hyphens. Resize the window to make them visible one by one:
Margaret­Are­You­Grieving­Over­Goldengrove­Unleaving­Leaves­Like­The­Things­Of­Man­You­With­Your­Fresh­Thoughts­Care­For­Can­You­Ah­As­The­Heart­Grows­Older­It­Will­Come­To­Such­Sights­Colder­By­And­By­Nor­Spare­A­Sigh­Though­Worlds­Of­Wanwood­Leafmeal­Lie­And­Yet­You­Will­Weep­And­Know­Why­Now­No­Matter­Child­The­Name­Sorrows­Springs­Are­The­Same­Nor­Mouth­Had­No­Nor­Mind­Expressed­What­Heart­Heard­Of­Ghost­Guessed­It­Is­The­Blight­Man­Was­Born­For­It­Is­Margaret­You­Mourn­For

How to remove invisible line break character

I have big data at excel, and some cells contains html codes. These cells have line breaks in them. I tried to replace line breaks (Alt+010, \n) but excel said there is no char like this.
When I copied cell to notepad, there is no line break.
When I copied from notepad to phpmyadmin sql area or textpad, I see line breaks again.
There are notepad, textpad and phpmyadmin sql area screenshots below. How can I remove these invisible line breaks?
This could be a problem with Carriage Return + Line Feed. When you press Alt+Enter in Excel it only incerts a Line Feed. But if you somehow get both Carriage Return + Line Feed in a cell that could leed to additional problems. See this page for solutions:
https://www.ablebits.com/office-addins-blog/2013/12/03/remove-carriage-returns-excel/
Did you try to remove any unnecessary tab within the code? Also check for some trivial things like e.g string max length in your mysql database or editor's miscellaneous settings.
EDIT. oh, I forgot. It may be also caused by your language settings, check for default database's regional coding preset and if Turkish is currently supported.
Line breaks - do you mean the line breaks you could introduce in Excel with ALT+ENTER?
Then you could use Search / Replace option in Excel without need to copy your content to another tool:
Open it and introduce in Search for CTRL+J (you will receive a point displayed in the search field).
In Replace you could introduce what you want (nothing, a space, a semicolon, ...).
Select Replace all.
EDIT:
I've tested it by copying html from textpad to one cell using clipboard. With this the method described by me is not working.
But there is another solution: Open replace command, for "search string" introduce ALT-Key (keep it pressed), then introduce by using the numeric key pad (on the right side of a "standard" keyboard) the tree digits 0 1 0 and finally release ALT-Key (you will see a point displayed in the search field). Choose as replacement string what you want and choose replace all.
Function =clean() helped me. Find/replace with ALT+J worked to replace, but did not fully deleted all the invisible characters in the string, so the cell was still misbehaving with text in columns. The =clean() function finally removed all the invisible characters left there.

Notepad++ Find and Select Specific Text or Number in my case

I am trying to edit a .srt file, and I am stuck on a specific task. I am sure there may be an easier way, but after searching for a couple hours, I am unable to find anything that helps me. I am trying to select all occurrences of the string "1" and then use the column editor to increment those occurrences by 1.
The first picture here shows the main issue in my .srt file. I am wanting to Select, not highlight all of the values that are currently highlighted in green. The find and replace box doesn't seem to help any because I need to do my increment operation using the column editor on the selected string. I have also tried the mark feature and that didn't do any good either.
Once I have them selected I can do These operations.
I know that I can hold the ctrl key down and manually select the lines that I need to edit, but that would take forever. It is kind of frustrating knowing that the text I need to select is already highlighted in green, but not selected. I am only a novice user when it comes to Notepad++ so I don't know all the features. Any help would be much appreciated. Thanks.
This is not possible to select that text easily. However, if you have PythonScript plug-in, this is easily done with Python script like
counter = -1
def increment_whole_line_number(match):
global counter
counter += 1
return str(int(match.group())+counter)
editor.rereplace(r'(?m)^\d+$', increment_whole_line_number)
The (?m)^\d+$ regex matches a whole line that consists of digits only (1 or more digits).
Here are the instructions on how to install the working PythonScript version (as the built-in does not work for me for some reason).
Here is my test:

How to remove line endings on multiple lines in visual studio 2012

In the visual studio 2012 editor, I don't need to remove entire or multiple blank lines as all of the other stuff I could search on S/O is concerned with. I want to select multiple lines of aspx markup (usually from 2 to 10 or so) and remove the line endings on multiple lines of source code so that you end up with everything that was in the selected lines on one line. A small example of what I want to do is:
BEFORE source code:
[dx:GridViewTextColumn ID="Inactive"
Width="50"]
[/dx:GridViewTextColumn]
AFTER:
[dx:GridViewTextColumn ID="Inactive" Width="50"][/dx:GridViewTextColumn]
(replace the "[" chars above with "<" chars, and "]" with ">" chars, I entered it that way just to get it to display somewhat properly here)
It seems like this should be pretty simple, but I have tried various search/replace and regex values that are talked about in the many articles that talk about removing entire blank lines, but can't get anything to work. A little help? :)
** 2014-02-06 at 2306 hrs update:
Still trying, but this gets me really close:
In Visual Studio 2012 ide.
Working in an aspx file with its xml markup.
Do Ctrl-H to do a string search/replace on a selected stretch of xml (from start to finish of a particular well-formed tag, which may or may not contain subtags, but each tag is on a separate line).
Specify the following in the from textbox:
\s{2,}
Specify one blank space in the to textbox.
For the first example I gave, the result would be:
[dx:GridViewTextColumn ID="Inactive" Width="50"] [/dx:GridViewTextColumn]
Note the single blank space between the separate tags (after the first ']' character and before the second '[' character) . If I could figure out how to not have that space in the result it would be perfect.
** 2014-02-06 at 2322 hrs update:
Oh duh. Otay, I think I got it, the from textbox value is the same, but for the to textbox value, instead of a single space, just have nothing. That seems to work for my specific use case (selecting a certain amount of xml within aspx markup and making it all be on a single line with no extraneous blank spaces). Yay!
In the VS2012 ide, Ctrl-H dialog, specify regex, then in the from textbox put:
\s{2,}
and in the to textbox put nothing.
Execute on whatever amount of xml that you have selected (from the beginning tag less-than character to its matching ending tag greater-than character, along with any/all subtags in between, over any number of lines of source code).
What you have selected will be condensed to one line of source code without any extraneous blank spaces present.
This seems to work for the xml that is in .NET aspx markup (what I specifically needed); not guaranteed to work anywhere else.

Visual Studio 2012 Express incorrect behavior of text cutting

Let me explain what I mean.
Example:
1) I am cutting some text on line 1 (or some count of lines)
2) I am deleting empty line 1, that remained after text cutting
3) I am trying to paste cutted text to other place, but all what I get is an empty string! WTF (Why this Fhappens)??
If I`ll do 3rd step before 2nd, I`ll get normal text pasting. But most of time I need to do 2nd step before 3rd.
Some of my coworkers get this bug too on Visual Studio Proffessional.
May be you had seen this bug too?
How are you deleting the empty line? If you're using CTRL-X or CTRL-Del, both of these commands will actually do a Cut command on the line.

Resources