Questions tagged [number-formatting]

Editing several numbers at once in a way that will keep their ordering and format (e.g. binary, octal, hex) unaltered.

Filter by
Sorted by
Tagged with
1
vote
1answer
33 views

substitution of increasing numbers per row

Each row is: Or(a=a[0], b=b[0], out=out[0]); Or(a=a[0], b=b[0], out=out[0]); Or(a=a[0], b=b[0], out=out[0]); and I need: Or(a=a[0], b=b[0], out=out[0]); Or(a=a[1], b=b[1], out=out[1]); Or(a=a[2], b=b[...
1
vote
1answer
87 views

How do I add a thousand seperator to a number?

Is it possible to add a thousands separator to a number or a selection of numbers? Before 42 4815162342 After 42 4.815.162.342 I have to perform this operation quite often, which is why I would ...
8
votes
4answers
2k views

Increment numbers in text

I have a markdown file like this: Irish Bands: 1. U2 2. The Cranberries 3. The Dubliners English Bands: 1. Queen 2. Duran Duran 3. The Beatles American Bands: 1. Nirvana 2. Blondie 3. The Doors I ...
0
votes
1answer
92 views

Increment the Nth number in the line

Ctrl-A is very useful for incrementing the first number in line, but what if the number you want to increment is not the first one? for an example, if want to make, Section. 1-1 Section. 1-2 ...
0
votes
1answer
59 views

Precision format in Vi

Is there a way to format numbers as per a precision format in Vi? I have a log file with a huge list of hexadecimal numbers, I would like to remove the '0x' prefix; then make the numbers show up ...
8
votes
1answer
17k views

Find and replace all numbers with 0?

Is there a command to find and replace all instances of a number in a file with 0 (including decimal numbers like 1.7)?
6
votes
1answer
356 views

Understand addition on numbers in Vim

I have a file with the following content: 001 Now if I start a macro (qq), yank this line (Y), paste it (p), increase the number by four (4Ctrlaa), end the macro (q), and execute this macro nine ...
8
votes
2answers
592 views

How I force [count]<C-x> to leave leading zeros?

Context I use vifm as my file manager (that's off topic here, i know, but keep reading) which allows me to edit filenames inside a vim buffer. One issue i found myself annoyed at are numbered files ...