Sponsored Content
Top Forums Shell Programming and Scripting I need help editing a pgn file Post 302372148 by gandolf989 on Tuesday 17th of November 2009 06:56:37 AM
Old 11-17-2009
MySQL

Thanks for the replies. This is the basic format that I am looking for. The awk command just seemed to remove the carriage returns and lines that begin with [.

Code:
^M 1.c4 Nf6 2.Nc3 e6 3.e4 d5 4.e5 d4 5.exf6 dxc3 6.bxc3 Qxf6 7.Nf3 e5 8.Bd3 Nc6^M 9.O-O Bd6 10.Be4 Bf5 11.Qc2 Bxe4 12.Qxe4 Qg6 13.Qd5 O-O-O 14.Qb5 e4 15.Nh4 Qf6^M 16.Nf5 Ne5 17.Ng3 c6 18.Qa4 Qg6 19.Qxa7 Bb8 20.Qc5 Rd3 21.Rb1 h5 22.Qb4 Rd7^M 23.c5 f5 24.Kh1 h4 25.Ne2 Nd3 26.Qc4 Qf6 27.f3 exf3 28.Nd4 fxg2+ 29.Kxg2 Qg5+^M 30.Kh1 h3  0-1^M ^M ^M 1.d4 Nf6 2.c4 e6 3.Nc3 Bb4 4.f3 c5 5.d5 O-O 6.e4 d6 7.Bd3 b5 8.Ne2 exd5 9.cxd5 c4^M 10.Bc2 Qb6 11.Nd4 Na6 12.a3 Bc5 13.Ndxb5 Bd7 14.a4 Nb4 15.Na3 Bf2+ 16.Kf1 Rac8^M 17.Bb1 Nh5 18.g4 Nf6 19.Qe2 Bd4 20.Kg2 Rfe8 21.Qd2 h5 22.g5 Nh7 23.a5 Qc5^M 24.Rd1 Be5 25.f4 Bxc3 26.bxc3 Nd3 27.Bxd3 cxd3 28.Qxd3 Qxc3 29.Qxc3 Rxc3^M 30.Rd4 f5 31.Bd2 Rb3 32.Nc4 Rxe4 33.Rxe4 fxe4 34.Re1 Rd3 35.Be3 a6 36.Kf2 Nf8^M 37.Rb1 Rxd5 38.Rb6 Bb5 39.Nxd6 Bd3 40.f5 Rxa5 41.Kg3 Rd5 42.g6 Nd7 43.Rc6 Kf8^M 44.Bg5 Rc5 45.Rxc5 Nxc5 46.Kf4 a5 47.Ke5 a4 48.Bc1 Nd7+ 49.Kd4 Ke7 50.Nxe4 Bxe4^M 51.Ba3+ Kf6 52.Kxe4 Kg5 53.Be7+ Nf6+ 54.Ke5 a3 55.Bxa3 Ng4+ 56.Ke6 h4 57.h3 Ne3^M 58.Bc1 Kh5 59.f6  1-0^

But this is what I was looking for.

Code:
[Event "Wch U16"]
[Site "Singapore"]
[Date "1990.??.??"]
[Round "?"]
[White "Barkhagen, Jonas"]
[Black "Zhu Chen"]
[Result "1-0"]
[WhiteElo "2235"]
[BlackElo ""]
[ECO "E20"]
1.d4 Nf6 2.c4 e6 3.Nc3 Bb4 4.f3 c5 5.d5 O-O 6.e4 d6 7.Bd3 b5 8.Ne2 exd5 9.cxd5 c4 10.Bc2 Qb6 11.Nd4 Na6 12.a3 Bc5 13.Ndxb5 Bd7 14.a4 Nb4 15.Na3 Bf2+ 16.Kf1 Rac8 17.Bb1 Nh5 18.g4 Nf6 19.Qe2 Bd4 20.Kg2 Rfe8 21.Qd2 h5 22.g5 Nh7 23.a5 Qc5 24.Rd1 Be5 25.f4 Bxc3 26.bxc3 Nd3 27.Bxd3 cxd3 28.Qxd3 Qxc3 29.Qxc3 Rxc3 30.Rd4 f5 31.Bd2 Rb3 32.Nc4 Rxe4 33.Rxe4 fxe4 34.Re1 Rd3 35.Be3 a6 36.Kf2 Nf8 37.Rb1 Rxd5 38.Rb6 Bb5 39.Nxd6 Bd3 40.f5 Rxa5 41.Kg3 Rd5 42.g6 Nd7 43.Rc6 Kf8 44.Bg5 Rc5 45.Rxc5 Nxc5 46.Kf4 a5 47.Ke5 a4 48.Bc1 Nd7+ 49.Kd4 Ke7 50.Nxe4 Bxe4 51.Ba3+ Kf6 52.Kxe4 Kg5 53.Be7+ Nf6+ 54.Ke5 a3 55.Bxa3 Ng4+ 56.Ke6 h4 57.h3 Ne3 58.Bc1 Kh5 59.f6  1-0

 

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
Locale::Codes::LangFam(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangFam(3pm)

NAME
Locale::Codes::LangFam - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangFam; $lext = code2langfam('apa'); # $lext gets 'Apache languages' $code = langfam2code('Apache languages'); # $code gets 'apa' @codes = all_langfam_codes(); @names = all_langfam_names(); DESCRIPTION
The "Locale::Codes::LangFam" module provides access to standard codes used for identifying language families, such as those as defined in ISO 639-5. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639-5 language family codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language families. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langfam('apa','alpha'); $lext = code2langfam('apa',LOCALE_LANGFAM_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from ISO 639-5 such as 'apa' for Apache languages. This is the default code set. ROUTINES
code2langfam ( CODE [,CODESET] ) langfam2code ( NAME [,CODESET] ) langfam_code2code ( CODE ,CODESET ,CODESET2 ) all_langfam_codes ( [CODESET] ) all_langfam_names ( [CODESET] ) Locale::Codes::LangFam::rename_langfam ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangFam::add_langfam ( CODE ,NAME [,CODESET] ) Locale::Codes::LangFam::delete_langfam ( CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_alias ( NAME ,NEW_NAME ) Locale::Codes::LangFam::delete_langfam_alias ( NAME ) Locale::Codes::LangFam::rename_langfam_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::delete_langfam_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.loc.gov/standards/iso639-5/id.php ISO 639-5 . AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2012 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-10-11 Locale::Codes::LangFam(3pm)
All times are GMT -4. The time now is 09:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy