EzDevInfo.com

text-formatting interview questions

Top text-formatting frequently asked interview questions

How to change Windows 10 Lock screen time format?

My Windows 10's time format is 24 hour clock, this includes the taskbar but the lock screen is still 12 hour clock format. How do I change the format of my time in lockscreen?


Source: (StackOverflow)

Use two columns in Microsoft Word separately

I want to do a two-column layout in Microsoft Word, but instead of the second column being written as a continuation of the first, I want the two columns to be written separately just like they were two different pages.

How would you go about doing this in Word 2010?


Source: (StackOverflow)

Advertisements

Strikethrough in notepad++

Is there anyway I can have text with strikethrough style in notepad++? I use notepad++ for my to-do lists, and being able to assign strikethrough to the highlighted text (especially if it could be on a keyboard shortcut) would be very useful.

[edit] Just to clarify - I realise that strikethrough is formatted text, and not that of a text editor. My query was more if there was something (a plugin maybe) that did some kind of markup which it rendered as strikethrough. I'm guessing not, but worth asking.


Source: (StackOverflow)

How to auto format code from the command line?

Let's say I have a JavaScript in someRandomFile.js and I want to run a command like:

formatMyCode someRandomFile.js

Then inside the file it just indent everything in a nice way.

I want to do format PHP or HTML too. In VIM you can highlight some text and press = and it'll automagically format it (even if it is mixed HTML/PHP/JavaScript). Is there an easy way to do it?


Source: (StackOverflow)

Formatting a comma-delimited CSV to force Excel to interpret value as a string

Searching around for a while trying to figure out how to format a CSV file in such a way to force Excel to interpret the values as a string and not try and convert them to numbers or dates.

e.g...

"141", "10/11/2002", "350.00", "1311742251"

Excel tries to "intelligently" convert all these to it's native date/number formats. Is there a way around that?


EDIT: Clarified the intent of my question, sorry for confusion.


Source: (StackOverflow)

How to format numbered lists pasted from Word into Notepad?

When I copy a numbered list from MS Word into Notepad, I get a large space between the numbers and the text.

How do I get rid of this space, please?


Source: (StackOverflow)

Is there a NetBeans formatter for eclipse?

My team uses NetBeans and has coalesced around NetBean's default formatting. Is there way to import NetBeans formatting rules for Java into Eclipse? There are a lot of Eclipse format plugins for NetBeans but none for the other way around, that I can find.


Source: (StackOverflow)

Missing the "L" shaped formatting icons in Microsoft Word

I am missing the "L" formatting (or maybe layout) things in Microsoft Word and don't know how to get them back.

Below screenshot I found shows the missing parts in red circles:

word doc with marks

How can I re-enable or show these things? They look like corners of a box.


Source: (StackOverflow)

Disable formatting in Eclipse

I found that when I save a .java file in Eclipse, it helps me to reformat any indentation and line breaks. This is very annoying. How can I avoid it?


Source: (StackOverflow)

Excel insists on formatting HTML

I need to copy around 15,000 rows of data from an MS SQL query to an Excel 2007 spreadsheet. Some of the cells contain HTML as plain text, and most of these include HTML tables. I want the HTML to stay plain text in Excel, tags and all; but no matter what I do, Excel sees the tags and renders the table, which completely messes up the sheet. Formatting the cells as text doesn't work. Paste Special > Text doesn't work. Copying the text of the individual cell containing HTML directly into the formula bar DOES work, but that's not really a feasible solution for 15,000 rows.

I know it's possible to keep HTML as plain text because I managed it once; I just don't remember how. I've also seen other questions from people having the opposite problem, so the functionality definitely exists.

I'm incredibly frustrated and would deeply appreciate your help.

Edit:

@variant: Pasting into Notepad and copying the text from there produces the same results as copying the query results directly. Also, data pasted into Notepad becomes tab-delimited, and there are indenting tabs in the HTML, so even if it got rid of the formatting, I'd think that would mess up the columns. The text also contains commas, so saving as a .csv doesn't help either. (I did try it.)

@Jay: Here's an example of the HTML, with irrelevant text replaced. Sorry about the horizontal scroll - since this is a formatting question, I thought it would be best to paste the text as-is. (I know the <li> tags are unclosed; I'm not concerned with fixing bad HTML in this case.)

    <center>  <table border="1" width="400" style="border: 1 solid #808080" cellpadding="2" cellspacing="0" bordercolor="#C0C0C0">      <tr align="center">      <td bordercolor="#800000" width="100%" height="14" style="background-color:#800000;"><font color="white">Header text</font></td>      </tr>      <tr>        <td width="100%" height="14">Paragraph of text</td>      </tr>      <tr align="center">        <td bordercolor="#800000" width="100%" height="14" style="background-color:#800000;"><font color="white">More text</font></td>      </tr>      <tr>        <td width="100%" height="14">  <ul><li>Bullet point   <li>Bullet point   <li>Bullet point   <li>Bullet point   <li>Bullet point   <li>Bullet point   <li>Bullet point</ul></td>      </tr>      <tr align="center">        <td bordercolor="#800000" width="100%" height="14" style="background-color:#800000;"><font color="white">More text</font></td>      </tr>      <tr>        <td width="100%" height="14">Some final text</td>      </tr>    </table>  </center>

Source: (StackOverflow)

How to prevent Excel to use the OS regional settings for date patterns in formulas

According to this question I have the following problem:

I want to use some Excel function (not the cell formatting) like TEXT(A1, {date_pattern})

But the person who answer my previous question make me found that the date pattern change according to the Windows Regional Settings.

However, my OS (Windows 7) is in English and the Office suite as well. By looking in my Regional settings it show even a pattern using English notation (dd.MM.yyyy)

Region and Language

I want to know if there is any way to disable such behaviour from Excel, meaning I want to always use the English patterns and never the localized ones because I do not want the behaviour of my Excel sheet to change according to localisation of the reader.

A simple case would be reformatting some date field to a computer centric way like this: "yyyymmdd_hhss" this is recognized universally and can be sorted up and down easily. But as I am in the French part of Switzerland part I should write "aaaammjj_hhss" and if I send this Excel to a colleague in Zürich he would not be able to see the proper date as he got the Swiss German localization (his excel would expect "jjjjmmtt_hhss")

We were clever enough to install all windows and office in English but we still face problem like this because this link to the OS regional settings.

For me the changing Windows Settings is not an option because all the other programs are using this settings.


Source: (StackOverflow)

Vim: auto-comment in new line

Vim automatically inserts a comment when I start a new line from a commented out line, because I have set formatoptions=tcroql. For example (cursor is *):

// this is a comment*

and after hitting <Enter> (insert mode) or o (normal mode) i am left with:

// this is a comment
// *

This feature is very handy when writing long multi-line comments, but often I just want a single line comment. Now if I want to end the comment series I have several options:

  • hit <Esc>S
  • hit <BS> three times

Both of these afford three keystrokes, taken together with the <Enter> this means four keystrokes for a new line, which I think is too much. Ideally, I would like to just hit <Enter> a second time to be left with:

// this is a comment
*

It is important that the solution will also work with different indentation levels, i.e.

int main(void) {
    // this is a comment*
}

hit <Enter>

int main(void) {
    // this is a comment
    // *
}

hit <Enter>

int main(void) {
    // this is a comment
    *
}

I think I have seen this feature in some text editor a few years ago but I do not recall which one it was. Is anyone aware of a solution that will do this for me in Vim? Pointers in the right direction on how to roll my own solution are also very welcome.


Source: (StackOverflow)

Formula does not show superscript character

I have a formula which I want to show a result which includes a superscript character, but I cannot get said character as superscript.

Normally I would just enter text into a cell and I can select just the character I want superscripted, right click, Format Cells and choose Superscript. However the Format Cells option is greyed out when I have a formula in the cell.

The formula in question is along the lines of;

="Area = "&A1"&"mm2"

To ideally give me an output of;

enter image description here

I have even tried putting the mm^2 text in its own cell and referencing that in the formula but still no joy.


Source: (StackOverflow)

How to break long lines in vim?

I have a quite big text file formed of blocks like

Short line.
Really long line.
Short line.

separated by empty lines, and I would like to use vim (on Linux) to break down the long lines and obtain blocks like

Short line.
This was
part of
a long line.
Short line.

My problem with gq (and gw) is that it reflows each block as an entire paragraph, i.e. it doesn't preserve the two line breaks within each block, and according to :help fo-table none of gq's format options would allow me to do what I want. I also thought that I could achieve my goal if I could define new-line characters to be paragraph delimiters, but according to :help paragraph those are hard-coded.

Edit: I know that I could use gq or gw to format each long line one by one, but since my file runs over a few thousand lines I am looking for a way to achieve this automatically.


Source: (StackOverflow)

How can I double space a document in LibreOffice?

A text file of a few pages and several paragraphs was read into LibreOffice Writer and needs to be double spaced throughout the document. The sequence:

Format -> paragraph -> Indents & Spacing -> Line spacing -> Double

affects only the paragraph where the cursor is positioned. Searching the web and help has not turned up a way to double space the document. (Although I'm certain I've done it before. Alas, I've got CRS (Can't Remember Stuff) syndrome.)


Source: (StackOverflow)