
uses
  SysUtils, Classes, RegExpr;

var
  SL, SL2: TStringList;
  i: integer;
  re: TRegExpr;
  
begin
  if ParamCount <> 2 then
    Exit;
  
  SL := TStringList.Create;
  SL2 := TStringList.Create;
  re := TRegExpr.Create('"([a-h1-8 ]+)"');
  try
    //SL.Sorted := TRUE;
    SL.LoadFromFile(ParamStr(1));
    
    for i := 0 to Pred(SL.Count) do
      if Length(SL[i]) > 0 then
        if re.Exec(SL[i]) then
          SL2.Append(re.Match[1])
        else
          WriteLn(ErrOutput, SL[i]);
        
    SL2.SaveToFile(ParamStr(2));
  finally
    SL.Free;
    SL2.Free;
    re.Free;
  end;
end.
