A quotation mark placed by the Eclipse editor works just fine in an XML file. Yet if I edit the XML in Microsoft Word and type in a new quotation mark and then place the XML back into Eclipse I get errors. The two quotation marks look different: one looks normal, while the one from Word looks like an italic version. When I replace the Word Quotation marks with the Eclipse marks the errors go away. I'm sure its different ascii codes. What's going on here?
Word is inserting smart quotes (that is the technical term for them). The ones that word puts are opening and closing ones. Word is created as a document editor, not a code editor. It puts in corrections to make your documents look better, not preserve language syntax. If you still want to use word as a code editor, you can disable smart quotes (in Word 2007 it is under Options > Proofing > AutoCorrect Options... > AutoFormat Tab > "Straight quotes" with "smart quotes")
Microsoft Word automatically changes quotation marks into curly quotation marks (left and right) as you type. The curly ones are not the same ACSII character as the normal quotation mark.
In Word 2003, there's a setting in AutoCorrect options in the AutoFormat As You Type tab that says replace "straight quotes with smart quotes", so you can disable this feature. I don't know where to find this setting in later versions of Word.
Related
In code files, when I expand selection, brackets, quotes, and spaces are used to delimit "levels" of expansion.
However, when I'm working in plain text, expand selection ignores brackets and goes from selecting one word to then selecting a whole line.
Is there any way to have expand selection respect brackets and quotes in plain text files?
Most text editors for writing code have settings that define which characters break words for things like keystroke navigation and tab-completion. Atom has a Non Word Characters field in the settings, Sublime Text has a JSON setting word_separators, and Visual Studio Code has a JSON setting editor.wordSeparators. There is some variation, but they all default to something similar to this backslash-escaped string
"`~!##$%^&*()-=+[{]}\\|;:'\",.<>/?"
None of them appear to include whitespace characters as word separators. This makes complete sense to me, but is it possible to prevent any of these editors (or an editor I haven't listed) from treating a single space as a word separator? I want to change this behavior because I have a special case where I'd like to tab-complete strings that contain single spaces.
I have a csv file that has random line breaks throughout the file. (probably load errors when the file was created where the loader somehow managed to put a carriage return into the field)
How do I go in and remove all carriage returns / line breaks where the last character is not "
I have word and sublime text available for text editors
I have tried ^p with a letter infront and find and replace, but that doesnt seem to work for some of the lines for some reason
Example
"3203","Shelving Units
",".033"
instead of
"3203","Shelving Units",".033"
and
"3206","Broom
","1.00"
instead of
"3206","Broom","1.00"
Menu > Find > Replace... or Ctrl+H
Select "Regular Expression" (probably a .* icon in the bottom left, depending on your theme).
Use \n to select newlines (LF) or \r\n (CRLF).
As #GerardRoche said you can use search and replace in Sublime Text. Open it via ctrl+h and press alt+r to toggle regex to enable it. (You may want to create a backup of your file before doing such changes.)
Search for (?<=[^"\n])\n+ and replace it with nothing, press Replace All or ctrl+alt+enter to replace it.
The regex just mean: search for alt least one (+) newlines (\n), that are preceded by something different than a quotation mark or a newline (?<=[^"\n]).
You don't need to worry about carriage returns, because ST only uses them when reading and writing the file and not in the editor.
There is a problem with the formatting of certain .docx files. I click to show the hidden formatting marks. There are degree symbols ("non-breaking spaces") in between many of the words, instead of a regular space.
To solve the problem: I copy and paste the degree symbol, and then I use the "find and replace" function to replace the degree symbols with a regular space.
How do I prevent this problem from occurring in the first place?
Or, how can I automatically convert these symbols to a regular space.
Non-breaking spaces are used to keep words from breaking across lines.
As Cindy stated above, the simplest way to remove them manually is to record a macro and execute this from a Ribbon button or the Quick Access Toolbar.
According to this link (and this link it refers to), nonbreaking spaces are inserted automatically if your proofing language is set to French and you type certain characters. To prevent this from happening, you have to either use a different proofing language or disable the "Replace straight quotes with smart quotes" option. To do this, see below (and I'm quoting the previous link):
To change the proofing language, select the text and click Language on
the Review tab. In addition to choosing another language, it's a good
idea to uncheck the option to automatically detect the language.
To change the quotes replacement, click File > Options > Proofing >
AutoCorrect Options, choose the AutoFormat As You Type tab of the
dialog (not just AutoFormat), and uncheck the first option.
I want to view a word document along with the unicode representation of the special characters.
For example, I want to a word doc containing :
Hi,
How are you ?
As ,
Hi \r\n How are you ?
Is there any way to do this?
Not programatically. Any software or software mode would suffice.
In Word, select the character and press "alt-x".
This appears to be unavailable in Word for Mac version 2016 (according to Microsoft Answers), or in Office 365's version 16.
If you want to see format control characters as visible symbols, which is what your example is about, then there does not seem to be any direct way. But if you click on the “¶” button (in the Start pane, Paragraph group in new versions of Word), Word adds symbols at ends of visible lines to indicate presence of such controls, e.g.
Hi,·¶
How·are·you?·¶
Here “¶” indicates the presence of CR (U+000D CARRIAGE RETURN, “\r”), whereas a symbol resembling “⤶” would indicate LF (U+000A LINE FEED, “\n”), which indicates a forced line break without paragraph break in Word. And “·” indicates a normal space (U+0020 SPACE), whereas “°” would indicate a no-break space (U+00A0 NO-BREAK SPACE).
For visible characters, the AltX method described by #JasonPlutext works well. You don’t even need to select the character. You can just click between it and the next character, to place the cursor there, and then press AltX.