Questions tagged [enumerate]

The tag has no usage guidance.

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

How to copy each line 19 times, incrementing two different numbers by 180?

I had asked a similar question previously (How to copy each line 11 times, incrementing the last "1" in each line from 2-12). I wasn't sure if I should ask this follow-up question in that ...
9
votes
5answers
3k views

How to copy each line 11 times, incrementing the last “1” in each line from 2-12

I have a number of lines in a file, and I would like to copy each line 11 times (turning each line into 12 lines), and increment the last "1" in each line so that the 12 lines have "1" through "12", ...
1
vote
3answers
482 views

How to append a random number between a range [1,10] at the end of each line in vim

I have a graph data in a file with each line containing the source and destination node of an edge. I want to assign a random weight between [1, 10] for each edge to test my graph algorithm. How can i ...
3
votes
0answers
127 views

How to convert lines to numbered list? [duplicate]

I've few lines (or paragraph if easier - {, }) which I would like to convert to numbered/ordered list, in example: Item one Item two Item three into: 1. Item one 2. Item two 3. Item three I would ...
23
votes
8answers
6k views

How to add permanent line numbers to a file?

I have a text file like this (using gVim on Windows) foo bar baz quux corge grault garply waldo fred plugh [...150 more lines...] xyzzy thud I want to add a number to each line in the file. Not ...