user32546: I'm using the --splitvariants flag to generate cards for anki, my problem is, how can i identify which line i'm playing? I though pgn-extract would have something like this, what i need is some way to append the variation name at the end of the line.

Please ignore the false keyword, what i need is to append a ;$VariantName at the end of each line

user32546: For @kentdjb and anyone interesed I solved my issue by doing the following:
First I downloaded an eco.pgn containing the names of openings and variations. You can find it here
Then I created an args file containing the following options:
:-C
:-e
:-w1000
:--minmoves 2
:-ofull-vienna.pgn
:--splitvariants
:--detag Event
:--detag Site
:--detag Date
:--detag White
:--detag Black
:--detag Result
:--detag ECO
:--detag Round
:--detag UTCDate
:--detag UTCTime
:--detag Annotator
:--detag Variant

Finally I ran the following command in my two pgn files containing vienna lines:
$ pgn-extract {vienna-foobar1,vienna-foobar2}.pgn -Aargs the output will throw something like this:
[Opening "Vienna gambit"]
[Variation "Paulsen attack"]

1. e4 e5 2. Nc3 Nf6 3. f4 d5 4. fxe5 Nxe4 5. Qf3 Nxc3 6. bxc3 Be7 7. d4 O-O 8. Bd3 Be6 9. Ne2 c5 10. O-O Nc6 11. Be3 *
1. e4 e5 2. Nc3 Nc6 3. Bc4 Bc5 4. Qg4 Qf6 5. Nd5 Qxf2+ 6. Kd1 Kf8 7. Nh3 h5 8. Qg5 f6 9. Qg6 Rh6 10. Ne7 *
1. e4 e5 2. Nc3 Nc6 3. Bc4 d6 4. d3 *
...

To convert this lines to anki cards I just use a vim macro to insert the $Opening and the $Variation at the end of each line.
Hope this is useful

32546: <p>I'm using the --splitvariants flag to generate cards for anki, my problem is, how can i identify which line i'm playing? I though pgn-extract would have something like this, what i need is some way to append the variation name at the end of the line.</p>
<p><a href="https://i.stack.imgur.com/LM8v0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LM8v0.png" alt="multiple chess lines" /></a></p>
<p>Please ignore the <code>false</code> keyword, what i need is to append a <code>;$VariantName</code> at the end of each line</p>
 32546: <p>For @kentdjb and anyone interesed I solved my issue by doing the following:</p>
<p>First I downloaded an eco.pgn containing the names of openings and variations. You can find it <a href="https://pastebin.com/raw/0izi8m8K" rel="nofollow noreferrer">here</a></p>
<p>Then I created an <code>args</code> file containing the following options:</p>
<pre><code>:-C
:-e
:-w1000
:--minmoves 2
:-ofull-vienna.pgn
:--splitvariants
:--detag Event
:--detag Site
:--detag Date
:--detag White
:--detag Black
:--detag Result
:--detag ECO
:--detag Round
:--detag UTCDate
:--detag UTCTime
:--detag Annotator
:--detag Variant
</code></pre>
<p>Finally I ran the following command in my two pgn files containing vienna lines:</p>
<p><code>$ pgn-extract {vienna-foobar1,vienna-foobar2}.pgn -Aargs</code> the output will throw something like this:</p>
<pre><code>[Opening &quot;Vienna gambit&quot;]
[Variation &quot;Paulsen attack&quot;]

1. e4 e5 2. Nc3 Nf6 3. f4 d5 4. fxe5 Nxe4 5. Qf3 Nxc3 6. bxc3 Be7 7. d4 O-O 8. Bd3 Be6 9. Ne2 c5 10. O-O Nc6 11. Be3 *
1. e4 e5 2. Nc3 Nc6 3. Bc4 Bc5 4. Qg4 Qf6 5. Nd5 Qxf2+ 6. Kd1 Kf8 7. Nh3 h5 8. Qg5 f6 9. Qg6 Rh6 10. Ne7 *
1. e4 e5 2. Nc3 Nc6 3. Bc4 d6 4. d3 *
...
</code></pre>
<p>To convert this lines to anki cards I just use a vim macro to insert the <code>$Opening</code> and the <code>$Variation</code> at the end of each line.</p>
<p>Hope this is useful</p>
