Questions tagged [numbering]
34 questions
205
votes
11 answers
List files sorted numerically
I have a bunch of files from log1 to log164.
I'm trying to LIST the directory (sorted) in a UNIX terminal but the sort functions are only providing the format like this:
home:logs Home$ ls -1 |…
Rabiani
15
votes
3 answers
Are the major, minor number unique
Are the major, minor number Unique?
Do we have any citations and reference to it?
NAME MAJ:MIN RM SIZE RO MOUNTPOINT
sda 8:0 0 465.8G 0
├─sda1 8:1 0 298.2M 0
├─sda2 8:2 0 3G 0
├─sda3 8:3 0 458.7G 0 /
├─sda4 …
Deepak Ingole
- 467
- 2
- 8
- 16
8
votes
3 answers
ffmpeg -pattern_type glob -- not loading files in correct order
I have a dilemma..
I've had a script for a while now that downloads pictures from a webcam every few minutes.
The naming convention just does new_image((len(files(dir))+1) + '.jpg') and that's all fine.. until today..
I've had a Python script that…
Torxed
- 3,567
- 7
- 27
- 44
5
votes
1 answer
How to number paragraphs
I know I have already asked this question, but I didn't get an answer that worked. So please could someone answer my question?
I have a text file, containing paragraphs of text, each separated by a single empty line. Now I need to number each…
Inquirer
- 163
- 1
- 4
5
votes
3 answers
Delta of numbers in file
On our server a cronjob has logged a count of files in a shared directory. The log is of the form:
2003-07-03T16:05 279
2003-07-03T16:10 283
2003-07-03T16:15 282
By now this file has far over a million entries. I am interested in finding the…
user90256
- 67
- 6
4
votes
1 answer
sed: append line and number output
In Linux, say one wants to add the following line before line number five (thus line nuber 5 becomes line number 6) and wants to have all the lines in the output numbered throught the sed 'tool' =
sed -n '5\Insert this line before line nuber 29'…
erch
- 4,890
- 17
- 49
- 81
3
votes
3 answers
Numbering poems stanzas using roman numerals
I would be able to numbering, sequentially, any stanza of a certain poem using roman numerals like this:
Injurious love, why still to mar accord
Between desires has been thy favourite feat?
Why does it please thee…
Dingo
- 329
- 1
- 5
3
votes
2 answers
Collapsing a series of comma separated numbers in a sequence to Beginning-End
Problem I am trying to solve/enhance a BASH script that provides a number sequence:
I am using a topologically aware tool (lstopo-no-graphics) to extract physical processor numbers to use for input to numactl for processor binding.
Example output…
Goomba1050
- 33
- 5
3
votes
3 answers
swapping fields in columns by fixed pattern (yes, no, no, yes)
I want to produce a following list of pages (for imposition work); (number of pages is variable, but I make a sample of my needs using a list of 16 pages, logic is the same for longer lists)
1,16
8,9
15,2
10,7
3,14
6,11
13,4
12,5
I written this for…
Dingo
- 329
- 1
- 5
3
votes
6 answers
Add consecutive numbers succintly and elegantly to index lines
I usually do this
$ wc questions
33 36 3105 questions
$ seq 1 33 > nums
$ paste nums questions
1 Content
2 ...
.
.
33 End Content
but I feel there could be faster way to do this, without the bad-looking dummy file. How with…
user2362
3
votes
2 answers
Override page numbers of a djvu document
I have a djvu scan of a book. Let's consider two cases:
I'd like to number the pages 0, 1, 2, ... (usage case: the cover should get be page 0)
I'd like to number some pages with Roman numbers and some with Arabic numbers, for example: i, ii, iii,…
marmistrz
- 2,732
- 4
- 23
- 30
2
votes
2 answers
How Can I Find Five Numbers Between Two Numbers
Suppose I have these two numbers: 800000 and 3200000. I want to find five numbers with an even difference in between these two numbers. Therefore, I want the output to be:
800000
1200000
1600000
2000000
2400000
2800000
3200000
I know about the seq…
Amarakon
- 289
- 3
- 9
2
votes
3 answers
repeat twice each couple of strings in a for cycle
I need to pass to pdftk, a list of arguments constituted by strings repeated twice like:
A1-2 B1-2 A3-4 B3-4 A5-6 B5-6... and so on...
I managed to achieve this with this workaround
for ((x=1, y=2;x>=18, y<=18;x++, y++)); do echo "A$x-$y B$x-$y ";…
Dingo
- 329
- 1
- 5
2
votes
3 answers
Extract line number of a file which is having a non zero value before a specified string
I'm having a file which contains following data
1. verification: 10 passed 0 failed
2. verification: 10 passed 0 failed
3. verification: 10 passed 1 failed
4. verification: 10 passed 3 failed
5. verification: 10 passed 0 failed
I want to know the…
Chinna
- 123
- 1
- 4
1
vote
3 answers
Restarting poem line numbering any 4 lines after a blank space
This is related to very interesting answer given here: Any text utility or hack to numbering poems lines omitting certain numbers?
awk 'FNR % 4 == 0 { printf "%6i %s\n", FNR, $0 ; next }; {printf "%6s %s\n", "", $0}' poem.txt
That does the job of…
Dingo
- 329
- 1
- 5