Miq19 has asked for the wisdom of the Perl Monks concerning the following question:
But the output is ignoring the minimum string widths in the printf() statementmy $last_k = 'NIL'; my $last_n = 'NIL'; foreach my $c (sort @chords) { (my $k, my $n) = split(/;/, $c); if ($last_k eq $k) { if ($last_n ne $n) { my $out = sprintf("Two names: '%-16s', '%-16s' for ", $last_n, $ +n); print $out . " " . ¬enames($k) . "\n"; $duplicates++; } } ($last_k, $last_n) = ($k, $n); } print "$duplicates multiple chord names\n";
For the life of me I cannot see my fault...... lines deleted ... Two names: 'E6/11/C#', 'E6/11/Db' for C#/Db4, E4, G#/Ab4, A4, Two names: 'E13/C#', 'E13/Db' for C#/Db4, E4, G#/Ab4, D5, Two names: 'E6/9/C#', 'E6/9/Db' for C#/Db4, E4, G#/Ab4, F#/Gb5 +, Two names: 'C#maj7(b5)', 'Dbmaj7(b5)' for C#/Db4, F4, G4, C5, Two names: 'C#(b5)', 'Db(b5)' for C#/Db4, F4, G4, Two names: 'Fm6#5/C#', 'Fm6#5/Db' for C#/Db4, F4, G#/Ab4, D5, Two names: 'Faug6', 'Faug6/C#' for C#/Db4, F4, A4, D5, Two names: 'A#aug6/D', 'Bbaug6/D' for D4, F#/Gb4, G4, A#/Bb4, Two names: 'F#6/11/D#', 'F#6/11/Eb' for D#/Eb4, F#/Gb4, A#/Bb4 +, B4, Two names: 'F#6/11/Eb', 'Gb6/11/Eb' for D#/Eb4, F#/Gb4, A#/Bb4 +, B4, Two names: 'F#13/D#', 'F#13/Eb' for D#/Eb4, F#/Gb4, A#/Bb4, E5 +, Two names: 'F#maj13/Eb', 'Gbmaj13/Eb' for D#/Eb4, F#/Gb4, A#/B +b4, F5, 372 multiple chord names
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Minimum width in printf() ignored?
by hippo (Archbishop) on Sep 01, 2024 at 11:14 UTC | |
by Miq19 (Novice) on Sep 01, 2024 at 15:24 UTC | |
|
Re: Minimum width in printf() ignored?
by Anonymous Monk on Sep 01, 2024 at 15:47 UTC | |
by Miq19 (Novice) on Sep 01, 2024 at 16:01 UTC | |
by Anonymous Monk on Sep 02, 2024 at 15:20 UTC |