Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change all characters in a column over multiple lines

I'm not sure how to explain what I'd like to do, but I've seen this in Textmate and it was quite useful. Let's say I have this text:

:aa => foo,
:ab => foo,
:ac => foo,
:ad => foo

Now I want to select all first characters of the keys (the 4 'a' in the lne) and remove them, so that the result looks like this:

:a => foo,
:b => foo,
:c => foo,
:d => foo

Some kind of visual mode accounting columns not lines.

like image 724
Lennart Koopmann Avatar asked May 06 '11 20:05

Lennart Koopmann


People also ask

How to allow more than 255 characters in MS List column?

Refer to Multiple lines of text, A Multiple lines of text column can store up to 63,999 characters by default. There’s no settings you need to change to allow more than 255 characters. Based on my test, it also works well for Microsoft List. The “ allow unlimited length ” option is only in library UI.

How do I change the character Count of a column?

Use text to column, choose fixed width and choose the character count you want. It will separate antything above the limit to a new column that you can delete. To post as a guest, your comment is unpublished.

How to put multiple lines of text in Excel?

1. Right click the cell you want to put multiple lines, then click Format Cells. See screenshot: 2. In the Format Cells dialog box, check the Wrap text box under the Alignment tab, and then click the OK button. Note: You can also just click Home > Wrap Text to put the overwriting text string to multiple lines.

How many characters can be stored in multiple lines of text?

Refer to Multiple lines of text, A Multiple lines of text column can store up to 63,999 characters by default. There’s no settings you need to change to allow more than 255 characters.


3 Answers

Use vim in column mode. To use it, press:

  1. Ctrl+V to go into column mode.
  2. Select the columns and rows where you want to enter your text.
  3. Shift+I to go into insert mode in column mode.
  4. Type in the text you want to enter.

    Note: Don't be discouraged by the fact that only the first row is changed.

  5. Esc to apply your change (or alternately Ctrl+C).

You will now see your changed applied.

Source: Column Edit Mode in VI.

like image 73
Marcin Avatar answered Oct 26 '22 18:10

Marcin


Use Ctrl+V to enter blockwise visual mode. You can then select a block of text using the normal movement keys and press x to delete it. I will perform a multi-line insert.

See :help ^V and :help visual-operators in vim for full details.

like image 9
John Kugelman Avatar answered Oct 26 '22 18:10

John Kugelman


Use Ctrl-V to select in block mode, then directional and editing commands to do the rest. See How to remove quotes surrounding the first two columns in Vim?

like image 2
Alanyst Avatar answered Oct 26 '22 16:10

Alanyst