Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-19T07:11:38.523Z
Answers.Text: I'm glad you solved it. Often, post-processing pgn-extract output with another program is the best way to get exactly what you want.
Answers.UserDisplayName: kentdjb
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-19T14:27:46.297Z
Answers.Text: Thanks for creating such an amazing program, it would be good if you could allow the `--detag` flag to receive multiple tags at one, like this: `--detag "tag1,tag2"`. At first i was using the `-Rtags --xroster` option but then i realize some games doesn't contain all the tags i specify inside the `tags` file
Answers.UserDisplayName: Carlos
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-20T15:44:04.453Z
Answers.Text: I'm glad you like the program. I could add something like that to --detag. I will put it on my list of improvements.
Answers.UserDisplayName: kentdjb
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-18T21:48:31.473Z
Answers.LastActivityDate: 2022-12-18T22:27:19.260Z
Answers.LastEditDate: 2022-12-18T22:27:19.260Z
Answers.UserDisplayName: Carlos
Body: <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.sstatic.net/LM8v0.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-15T17:40:53.837Z
Comments.Text: There currently isn't a mechanism in pgn-extract for arbitrary output formats, but if you would like to contact me (the author of pgn-extract) via the email address that goes with the program then I will see if a custom solution might be possible for you.
Comments.UserDisplayName: kentdjb
Tags: <pgn>
Title: pgn-extract: specify variation name when using --splitvariants flag
ThreadText: # pgn-extract: specify variation name when using --splitvariants flag
  
  (Asked by: username_0 on 2022-12-15)
  
  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.
  
  [![multiple chess lines](https://i.sstatic.net/LM8v0.png)](https://i.sstatic.net/LM8v0.png)
  
  Please ignore the `false` keyword, what i need is to append a `;$VariantName` at the end of each line
  
  **Tags:** pgn
  
  > **Comments:**
  > **username_1**: There currently isn't a mechanism in pgn-extract for arbitrary output formats, but if you would like to contact me (the author of pgn-extract) via the email address that goes with the program then I will see if a custom solution might be possible for you.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-12-18. Score: 1 | Accepted answer
  
  For @username_1 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
  
  > **Comments:**
  > **username_1**: I'm glad you solved it. Often, post-processing pgn-extract output with another program is the best way to get exactly what you want.  
  > **username_0**: Thanks for creating such an amazing program, it would be good if you could allow the `--detag` flag to receive multiple tags at one, like this: `--detag "tag1,tag2"`. At first i was using the `-Rtags --xroster` option but then i realize some games doesn't contain all the tags i specify inside the `tags` file  
  > **username_1**: I'm glad you like the program. I could add something like that to --detag. I will put it on my list of improvements.  
  
  ---
  
  