If your data looks like this one :
{
"id":20,
"name":"started"
},
"createdAt":1519074805967,
"lastMove":"d7b5",
"opening":{
"eco":"A49",
"name":"Indian Game: Przepiorka Variation",
"ply":5
}
},
"clock":{
"running":true,
"initial":180,
"increment":0,
"white":126.26,
"black":120.08,
"emerg":22,
"moretime":15
},
"correspondence":null,
"player":{
"color":"white",
"name":null,
"user":{
"id":"chessbrahs",
"username":"chessbrahs",
"online":true,
"perfs":{
"blitz":{
"games":422,
"rating":2680,
"rd":72,
"prog":-15
}
},
"title":"GM",
"language":"en-GB",
"profile":{
"country":"CA"
}
},
"rating":2680,
"version":50,
"spectator":true
},
"opponent":{
"color":"black",
"name":null,
"user":{
"id":"norba94",
"username":"norba94",
"online":true,
"perfs":{
"blitz":{
"games":26725,
"rating":2302,
"rd":58,
"prog":21
}
},
"language":"hu"
},
"rating":2302
},
"orientation":"white",
"url":{
"socket":"/kpGSyZr1/white/socket",
"round":"/kpGSyZr1/white"
},
"pref":{
"animationDuration":100,
"coords":2,
"replay":2,
"clockTenths":1,
"clockBar":true,
"highlight":true,
"destination":true,
"rookCastle":true,
"showCaptured":true
},
"evalPut":true,
"userTv":{
"ply":37,
"uci":"c3d5",
"san":"Nd5",
"fen":"1qrr2k1/1p1bppbp/p2p2p1/P2Nn3/1n1NP3/6PP/1PP2PB1/R1BQR1K1 b - - 10 19"
},
{
"ply":38,
"uci":"b4d5",
"san":"Nxd5",
"fen":"1qrr2k1/1p1bppbp/p2p2p1/P2nn3/3NP3/6PP/1PP2PB1/R1BQR1K1 w - - 0 20"
},
{
"ply":39,
"uci":"e4d5",
"san":"exd5",
"fen":"1qrr2k1/1p1bppbp/p2p2p1/P2Pn3/3N4/6PP/1PP2PB1/R1BQR1K1 b - - 0 20"
},
{
"ply":40,
"uci":"d8e8",
"san":"Re8",
"fen":"1qr1r1k1/1p1bppbp/p2p2p1/P2Pn3/3N4/6PP/1PP2PB1/R1BQR1K1 w - - 1 21"
},
{
"ply":41,
"uci":"c2c3",
"san":"c3",
"fen":"1qr1r1k1/1p1bppbp/p2p2p1/P2Pn3/3N4/2P3PP/1P3PB1/R1BQR1K1 b - - 0 21"
},
{
"ply":42,
"uci":"e5c4",
"san":"Nc4",
"fen":"1qr1r1k1/1p1bppbp/p2p2p1/P2P4/2nN4/2P3PP/1P3PB1/R1BQR1K1 w - - 1 22"
},
{
"ply":43,
"uci":"g1h2",
"san":"Kh2",
"fen":"1qr1r1k1/1p1bppbp/p2p2p1/P2P4/2nN4/2P3PP/1P3PBK/R1BQR3 b - - 2 22"
},
{
"ply":44,
"uci":"b8c7",
"san":"Qc7",
"fen":"2r1r1k1/1pqbppbp/p2p2p1/P2P4/2nN4/2P3PP/1P3PBK/R1BQR3 w - - 3 23"
},
{
"ply":45,
"uci":"b2b4",
"san":"b4",
"fen":"2r1r1k1/1pqbppbp/p2p2p1/P2P4/1PnN4/2P3PP/5PBK/R1BQR3 b - - 0 23"
},
{
"ply":46,
"uci":"c4e5",
"san":"Ne5",
"fen":"2r1r1k1/1pqbppbp/p2p2p1/P2Pn3/1P1N4/2P3PP/5PBK/R1BQR3 w - - 1 24"
},
{
"ply":47,
"uci":"c1d2",
"san":"Bd2",
"fen":"2r1r1k1/1pqbppbp/p2p2p1/P2Pn3/1P1N4/2P3PP/3B1PBK/R2QR3 b - - 2 24"
},
{
"ply":48,
"uci":"e5c4",
"san":"Nc4",
"fen":"2r1r1k1/1pqbppbp/p2p2p1/P2P4/1PnN4/2P3PP/3B1PBK/R2QR3 w - - 3 25"
},
{
"ply":49,
"uci":"d2g5",
"san":"Bg5",
"fen":"2r1r1k1/1pqbppbp/p2p2p1/P2P2B1/1PnN4/2P3PP/5PBK/R2QR3 b - - 4 25"
},
{
"ply":50,
"uci":"d7b5",
"san":"Bb5",
"fen":"2r1r1k1/1pq1ppbp/p2p2p1/Pb1P2B1/1PnN4/2P3PP/5PBK/R2QR3 w - - 5 26"
}
]
},
i18n:{
"flipBoard":"Flip board",
"aiNameLevelAiLevel":"%1$s level %2$s",
"yourTurn":"Your turn",
"abortGame":"Abort game",
"proposeATakeback":"Propose a takeback",
"offerDraw":"Offer draw",
"resign":"Resign",
"opponentLeftChoices":"The other player may have left the game. You can claim victory, call the game a draw, or wait.",
"forceResignation":"Claim victory",
"forceDraw":"Call draw",
"threefoldRepetition":"Threefold repetition",
"claimADraw":"Claim a draw",
"drawOfferSent":"Draw offer sent",
"cancel":"Cancel",
"yourOpponentOffersADraw":"Your opponent offers a draw",
"accept":"Accept",
"decline":"Decline",
"takebackPropositionSent":"Takeback sent",
"yourOpponentProposesATakeback":"Your opponent proposes a takeback",
"thisPlayerUsesChessComputerAssistance":"This player uses chess computer assistance",
"gameAborted":"Game aborted",
"checkmate":"Checkmate",
"whiteResigned":"White
So, with this batch script, you can get this line : 2r1r1k1/1pq1ppbp/p2p2p1/Pb1P2B1/1PnN4/2P3PP/5PBK/R2QR3 w - - 5 26
@echo off
Set "Tmpvbs=%temp%\Tmpvbs.vbs"
Set "InputFile=file.txt"
Set "TmpFile=TmpFile.tmp"
Set "OutPutFile=file2.txt"
Call :Extract "%InputFile%" "%TmpFile%"
for /F "delims=" %%a in ('Type "%TmpFile%"') do (
echo %%a
)>"%OutPutFile%"
Del "%TmpFile%"
Start "" "%OutPutFile%" & exit
::****************************************************
:Extract <InputData> <OutPutData>
(
echo Data = WScript.StdIn.ReadAll
echo Data = Extract(Data,"\b[^""fen:](\w*)\/(\w*).*\b"^)
echo WScript.StdOut.WriteLine Data
echo '************************************************
echo Function Extract(Data,Pattern^)
echo Dim oRE,oMatches,Match,Line
echo set oRE = New RegExp
echo oRE.IgnoreCase = True
echo oRE.Global = True
echo oRE.Pattern = Pattern
echo set oMatches = oRE.Execute(Data^)
echo If not isEmpty(oMatches^) then
echo For Each Match in oMatches
echo Line = Line ^& Match.Value ^& vbcrlf
echo Next
echo Extract = Line
echo End if
echo End Function
echo '************************************************
)>"%Tmpvbs%"
cscript /nologo "%Tmpvbs%" < "%~1" > "%~2"
If Exist "%Tmpvbs%" Del "%Tmpvbs%"
exit /b
::****************************************************