I have a 10 GB text file, and I want to recursively check each line, if starts with a string, then replace the entire line.
Example of the text file
https://archive.org/download/lichess_db_standard_rated_2018-03.pgn/lichess_db_standard_rated_2018-03.pgn.bz2
[Event "Rated Classical game"]
[Site "https://lichess.org/0EyrbxKY"]
[Date "????.??.??"]
[Round "?"]
[White "takashigokturk"]
[Black "Andreslb"]
[Result "0-1"]
[WhiteElo "1257"]
[BlackElo "1234"]
[ECO "C41"]
[UTCDate "2017.07.31"]
[UTCTime "22:00:01"]
[WhiteRatingDiff "-12"]
[BlackRatingDiff "+11"]
[Opening "Philidor Defense #3"]
[TimeControl "600+0"]
[Termination "Normal"]
The problem is that the chessbase software has a limit on how many
sites can be within the file.
Example : In the record. the Site is written like this:
[Site “https://lichess.org/0EyrbxKY”]
I need and excitable that finds all lines in a file that start with
[Site
and replace that whole line with
[Site “lichess”]
As you can see this profile is many years old, I am not
a student or a programmer, but I would appreciate if I could
load this file in to a software, that limits how many different sites
that can be within one file.
To test the resulting file: The software is called SCID vs PC
it is free and open source.
I prefer a solution in C, but would welcome other suggestions and solutions.