Sponsored Content
Top Forums Shell Programming and Scripting I need help editing a pgn file Post 302371997 by gandolf989 on Monday 16th of November 2009 10:28:14 PM
Old 11-16-2009
MySQL I need help editing a pgn file

I have a bunch of files with the pgn files that represent chess games. I would like to combine the moves into a single line and get rid of the emtpy lines. Then I am planning on importing the games into a database where I can then create a database where I can search for specific games. I was thinking I could use either sed/awk or maybe tr. Thanks in advance.

Code:
[Event "8th Asian Continental Women"]
[Site "Subic Bay PHI"]
[Date "2009.05.23"]
[Round "11"]
[White "Zhu Chen"]
[Black "Zhang Jilin"]
[Result "1/2-1/2"]
[WhiteElo "2491"]
[BlackElo "2335"]
[ECO "B90"]

1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 6.h3 e5 7.Nde2 b5 8.g4 Bb7
9.Bg2 Be7 10.Ng3 O-O 11.O-O Nbd7 12.Nf5 Nc5 13.Bg5 b4 14.Bxf6 Bxf6 15.Nd5 Bg5
16.a3 bxa3 17.b4 Ne6 18.Nxd6 Bxd5 19.Qxd5 Nf4 20.Qxe5 Ne2+ 21.Kh1 Bf4 22.Qd5 Qxd6
23.Qc4 Nd4 24.Rfd1 Rac8 25.Qxd4 Qxd4 26.Rxd4 Be5 27.Rdd1 Bxa1 28.Rxa1 Rc3
29.e5 Rd8 30.Kg1 Rd4 31.Kf1 g5 32.Ke1 Rdc4 33.Bf1 Rxb4 34.Kd2 Rf3 35.Bd3 Ra4
36.Ra2 Rxh3 37.c4 Ra5 38.Kc3 Rxe5 39.Rxa3 Re8 40.Kc2 Rd8 41.f3 Kg7 42.Bf5 Re8
43.Rc3 Rh2+ 44.Kb3 Rb8+ 45.Ka3 Rh1 46.Ka2 Re1 47.Be4 Re8 48.c5 R1xe4 49.fxe4 Rxe4
50.c6 Re8 51.Kb3 h5 52.gxh5 Kh6 53.Rf3 Re7 54.Kc4 Kxh5 55.Kd5 g4 56.Rf1 g3
57.Kd6 Re2 58.Rxf7 Rd2+ 59.Ke6 Rc2 60.Kd7 Kh4 61.c7 g2 62.Rg7 Kh3 63.c8=Q Rxc8
64.Kxc8 a5 65.Rh7+ Kg3 66.Rg7+ Kf2 67.Rf7+  1/2-1/2

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Editing the end of the file without loading the entire file

hi! I am a newbee. I would really appreciate if you can answer the following question: I have a huge data file, 214MB with several coloumns. I need to delete the very last line of the file. Everything I know takes a lot of time to do it ( because I have to open the file in an editor or run a... (3 Replies)
Discussion started by: Garuda
3 Replies

2. Shell Programming and Scripting

Editing file

Hi, I am in a situation wherein am getting file file certailn values suppose 1u56979hhghhklklkkkjkjkjk 0 0 0 The file will have values like above only. I need to add another field of NULL value(of length 9) at the end of first column i.e. It should like this after editing:... (4 Replies)
Discussion started by: rahul303
4 Replies

3. Linux

file editing

I have created a file with vi -x (file name) this is encrypted file when i again open this file it ask me to enter a password before editing it.Can i remove this password but i don't want to delete a file how to do this. Thanks (0 Replies)
Discussion started by: ambavaram
0 Replies

4. Shell Programming and Scripting

editing a file

Hi i have a file name as file1 which has Following content: ROLLOVER_INTERVAL=0 OUTPUT_DIR_COUNT=MULTIPLE FILETYPE=XmlExporter i want to change the FILETYPE=recordexport can any one pls help me on this 2nd query: i want to change OUTPUT_DIR_COUNT=MULTIPLE as ... (2 Replies)
Discussion started by: Aditya.Gurgaon
2 Replies

5. Shell Programming and Scripting

editing a file

i am writing a script to edit entries in a file. what command will edit a specific file? ex: echo) "what number would you like to change read "number" this is where I am stuck. what command will edit my specific file? (3 Replies)
Discussion started by: gustave
3 Replies

6. Shell Programming and Scripting

Help with file editing while keeping file format intact

Hi, I am having a file which is fix length and comma seperated. And I want to replace values for one column. I am reading file line by line in variable $LINE and then replacing the string. Problem is after changing value and writing new file temp5.txt, formating of original file is getting... (8 Replies)
Discussion started by: Mruda
8 Replies

7. Shell Programming and Scripting

editing line in text file adding number to value in file

I have a text file that has data like: Data "12345#22" Fred ID 12345 Age 45 Wilma Dino Data "123#22" Tarzan ID 123 Age 33 Jane I need to figure out a way of adding 1,000,000 to the specific lines (always same format) in the file, so it becomes: Data "1012345#22" Fred ID... (16 Replies)
Discussion started by: say170
16 Replies

8. Shell Programming and Scripting

Need help in editing a file

I have a file which has 10 million records in it. When am trying to edit the file with vi, the following error occurs: ~ ~ ~ ~ ~ ~ ~ ~ "file1" Value too large for defined data type Is there any way that I can edit this file without using vi? Any help would be really appreciated.... (8 Replies)
Discussion started by: bobby1015
8 Replies

9. UNIX for Dummies Questions & Answers

File editing

Hi All, I've to edit the below file in the Current File: XXX Rows found with null for one or more non-nullable columns in the source table SELECT COUNT(*) FROM ( SELECT 1 as one FROM datum WHERE:wall: datum.ID IS NULL ) a (1 Reply)
Discussion started by: udayakumar
1 Replies

10. Shell Programming and Scripting

Convert vi editing to text editing

Dear Guru's I'm using Putty and want to edit a file. I know we generally use vi editor to do it. As I'm not good in using vi editor, I want to convert the vi into something like text pad. Is there any option in Putty to do the same ? Thanks for your response. Srini (6 Replies)
Discussion started by: thummi9090
6 Replies
gravitation(6)							       Games							    gravitation(6)

NAME
gravitation - a game about mania, melancholia, and the creative process. SYNOPSIS
gravitation DESCRIPTION
Gravitation is a video game written by Jason Rohrer about the creative process and the interaction between the creative process and life. Gravitation is an art game. As a result, some people love it and some people hate it. Check out the links to places it has been discussed on the website for some of the reactions. The mechanics of the game are fairly simple. Your "score" is related to the amount of "projects" you complete. To complete a project, first you need to discover and idea. In the game ideas are represented by blue stars and located in the maze above your initial position. To get to the maze, you can either wait till you feel inspired to jump that far, or you can play with your daughter and be inspired more quickly. Once you find an idea, it will fall to earth (so to speak), and you now need to "complete" the project by pushing the fallen star (now a white cube) into the fireplace. The game mechanics allow for myriad situations and exploring them can be an interesting experience. The most interesting part about this game is the emotions it evokes within the player of the game. The ultra-low-res pixel art helps here, by not being too distracting and by leaving plenty room for viewer interpretation. Gravitation is the follow-up to Passage, another art game by Jason Rohrer. USAGE
Gravitation has no command-line options. The left and right arrow keys move left and right. The spacebar is used to jump. Hold for higher jumps. The Esc key is used to quit the game. The game resolution and use of fullscreen or a window can be set by editing the files in /etc/gravitation. SEE ALSO
The website and discussion: http://hcsoftware.sourceforge.net/gravitation/ The game creators statement: http://hcsoftware.sourceforge.net/gravitation/statement.html March 2008 gravitation(6)
All times are GMT -4. The time now is 11:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy