Sponsored Content
Top Forums Shell Programming and Scripting Cut and paste data in new file Post 302674963 by asavaliya on Saturday 21st of July 2012 02:47:31 AM
Old 07-21-2012
Bug Cut and paste data in new file

HI Guys,

I have file A:

Code:
Abc XyZ Abc Xyz Kal Kaloo 
Abc XyZ Abc Xyz Kalpooo 
Abc XyZ Abc Xyz  Kloo 
Abc  Abc  Klooo

I want file B
Code:
Abc XyZ Abc Xyz Kal Kaloo 
Abc XyZ Abc Xyz Kalpooo 
Abc XyZ Abc Xyz  Kloo

File A is now 1 lines

Code:
Abc  Abc  Klooo

Cut all lines which have xyz and kal

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cut and paste using awk

Hi i need a favour i have a file which has some trillions of records. The file is like this 11111000000000192831840914000000000000000000000000000 45789899090000000000000000011111111111111111111111111 I want to cut specific postions in each line like cut1-3 and assisgn it to a variable and... (5 Replies)
Discussion started by: richa2.m
5 Replies

2. Shell Programming and Scripting

cut and paste?

hi, I have a file with content like this for an employee: EmployeeID 101 Day_type, day vacation,1/2/2009 sick day, 3/2/2009 personal day, 4/5/2009 jury duty day, 5/5/2009 how do I make the result to show: EmployeeID,Day_type,day 101,vacation,1/2/2009 101,sick day,... (6 Replies)
Discussion started by: jbchen
6 Replies

3. Shell Programming and Scripting

cut and paste

Hi, Need a help with shell script. I have to search for a string in one of the file, if match found, copy the line to a new file and delete the line from the exisiting file. eg: 83510000000000063800000.1800000.1600000.1600000.2400000.1800000.2000000.21... (6 Replies)
Discussion started by: gpaulose
6 Replies

4. Shell Programming and Scripting

Cut and paste data in matrix form

I have large formatted data file with five columns. This has to be rearranged in lower order matrix form as shown below for sample data. 1 2 3 4 5 1.0 3.0 2.0 5.0 3.0 2.0 4.0 3.0 1.0 6.0 2.0 3.0 4.0 5.0 1.0 1.0 4.0 2.0 3.0 5.0 3.0 5.0 4.0 2.0 8.0 1.0 3.0 2.0 4.0 5.0 2.0... (7 Replies)
Discussion started by: dhilipumich
7 Replies

5. UNIX for Dummies Questions & Answers

Cut paste from one file to other

Hello, I am working on unix for the first time. I have to write a shell script where i want to cut paste from one file to other. File "1234.abc" is 03,12345555 16,936,x,x,120 16,936,x,x,100 49,12345555 03,12347710 16,936,x,x,115 16,936,x,x,122 49,12347710 03,12342222... (9 Replies)
Discussion started by: swapsb
9 Replies

6. Shell Programming and Scripting

need help with cut and paste command

I have a file which contains 3 fields separated by tabs example andrew kid baker I need to swap kid and baker using cut and paste commands how is this to be done? Thanks (3 Replies)
Discussion started by: drew211
3 Replies

7. Shell Programming and Scripting

Help required the cut the whole contents from one file and paste it into new file

Hi, First of all sincere apologies if I have posted in a wrong section ! Please correct me if I am wrong ! I am very new to UNIX scripting. Currently my problem is that I have a code file at the location /home/usr/workarea/GeneratedLogs.log :- Code :- (Feb 7, 571 7:07:29 AM),... (4 Replies)
Discussion started by: acidburn_007
4 Replies

8. Shell Programming and Scripting

Issue with cut and paste

let i have A file and B file A has contains 4 fields as below ---------------- f1 f2 f3 f4 B file consists of 5 fields as below -------------------- f5 f6 f7 f8 f9 need to display as below output: f5 f1 f3 f8 f9 (2 Replies)
Discussion started by: ANSHUMAN1983
2 Replies

9. Shell Programming and Scripting

Cut, replace and Paste a String from one file to another

I need to cut all the Strings in one file and Paste it in the another file in the Specific line by replacing the specific String. For Example Step 1: From the newfile.txt, i need to copy all the strings newfile.txt How are you, I am fine, How is your work newfle2.txt Hello david,... (2 Replies)
Discussion started by: Padmanabhan
2 Replies

10. Shell Programming and Scripting

How to cut a pipe delimited file and paste it with another file to form a comma separated outputfile

Hello ppl I have a requirement to split (cut in unix) a file (A.txt) which is a pipe delimited file into A1.txt and A2.txt Now I have to join (paste in unix) this A2.txt with external file A3.txt to form output file A4.txt which should be CSV (comma separated file) so that third party can... (25 Replies)
Discussion started by: etldev
25 Replies
SGF2DG(1p)						User Contributed Perl Documentation						SGF2DG(1p)

NAME
sgf2dg - convert Smart Go Format (SGF) files to diagrams similar to those seen in Go books and magazines. SYNOPSIS
sgf2dg [ option ... ] file[.sgf|.mgt] DESCRIPTION
sgf2dg takes a Smart Go Format (SGF) file filename or filename.sgf or filename.mgt and produces a diagram file filename.suffix where suffix is determined by the converter (see below). The default converter is Dg2TeX which converts the Diagram to TeX source code (sgf2dg is a superset replacement for the sgf2tex script and package). If you have the GOOE fonts (provided in the same package as sgf2dg) correctly installed on your system you will be able to TeX filename.tex to produce a .dvi file. You can of course embed all or parts of filename.tex into other TeX documents. OPTIONS
-h | -help Print a help message and quit. -i | -in <filename> | <filename>.sgf | <filename>.mgt Specifies the input filename. (STDIN or none for standard input.) This option is not needed in ordinary use. -o | -out <filename> Specifies the output file. ('STDOUT' for standard output.) If the input file is <filename>, <filename>.sgf or <filename>.mgt, then <filename>.converter is the default (see the converter option). This option is not needed in ordinary usage. -t | -top <top line number> Specifies the top line to print. Default is 1. -b | -bottom <bottom line number> Specifies the bottom line to print. Default is 19. -l | -left <left line number> Specifies the leftmost line to print. Default is 1. -r | -right <right line number> Specifies the rightmost line to print. Default is 19. -break | -breakList <break list> 'break list' is a list of moves, separated by comma, with no spaces. These are breakpoints: each will be the last move in one diagram. -m | -movesPerDiagram <moves per diagram> 'moves per diagram' is a positive integer, specifying the maximal number of moves per diagram. Default is 50 unless -break or -breakList is set, in which case the default is set to a very large number (10,000). The two options -breakList and -movesPerDiagram may be used together. -n | -newNumbers Begin each diagram with the number 1. The actual move numbers are still used in the label. -newNumbers and -doubleDigits are alternative schemes for avoiding three-digit numbers in the diagrams. They should probably not be used together. -d | -doubleDigits If the first move of a diagram exceeds 100, the move number is reduced modulo 100. The actual move numbers are still used in the label. -newNumbers and -doubleDigits are alternative schemes for avoiding three-digit numbers in the diagrams. They should probably not be used together. -rl | -repeatLast The last move in each diagram is the first move in the next. This emulates a common style for annotating Go games. -il | -ignoreLetters Letters embedded in the SGF with the L or LB property are ignored. -im | -ignoreMarks Marks embedded in the SGF with the M or MA property are ignored. -ip | -ignorePass Passes are ignored. In sgf, a pass is a move at the fictitious point tt. Without this option, sgf2dg indicates passes in the diagram comments. -ia | -ignore all Ignore SGF letters, marks, variations and passes. -firstDiagram <diagram number> Specifies the first diagram to print. Default is 1. -lastDiagram <diagram number> Specifies the last diagram to print. Default is to print all diagrams until the end. -coords Generates a coordinate grid. This option may not be used with -twoColumn. -verbose Print diagnostic messages as the conversion proceeds. Most SGF properties produce some kind of message. -converter | -convert Selects different output converter plugins. Converters available with the current distribution package are: Games::Go::Dg2TeX TeX source (default) Games::Go::Dg2Mp MetaPost embedded in TeX Games::Go::Dg2ASCII simple ASCII diagrams Games::Go::Dg2PDF Portable Document Format (PDF) Games::Go::Dg2Ps PostScript Games::Go::Dg2Tk Perl/Tk NoteBook/Canvas Games::Go::Dg2TkPs PostScript via Dg2Tk (Dg2Ps is prefered) converters are quite easy to write - should take just a few hours if you are already conversant with the conversion target. If you would like to create a converter plugin module, the easiest way is probably to grab a copy of Dg2Ps.pm (for example) and modify it. Once it's working, please be sure to send us a copy so we can add it to the distribution. Converters are always prepended with 'Games::Go::Dg2', so to select the ASCII converter instead of the default TeX converter, use: -converter ASCII Converter names are case sensitive. The default output filename suffix is determined by the converter: the converter name is lower-cased to become the suffix, so the ASCII converter produces <filename>.ascii from <filename>.sgf. You can also select different converters by changing the name of the sgf2dg script (or better, make symbolic links, or copies if your system can't handle links). The converter name is extracted from the name with this regular expression: m/sgf2(.*)/ Anything after 'sgf2' is assumed to be the name of a converter module. For example, let's create a link to the script: $ cd /usr/local/bin $ ln -s sgf2dg sgf2Xyz Executing: $ sgf2Xyz foo.sgf [ options ] attempts to use Games::Go::Dg2Xyz as the converter. The converter name extracted from the script name is case sensitive. Note that three extracted names are treated specially: tex diagram dg These three names (when extracted from the script name) always attempt to use Games::Go::Dg2TeX as the converter. CONVERTER OPTIONS
Converters may be added dynamically as plugins, so this list only includes converter plugin modules that are included with the Sgf2Dg distribution. Converter options are prepended with the converter name so that option xyz for converter Games::Go::Dg2Abc is written on the command line as: $ sgf2dg ... -Abc-xyz ... Converter options that take arguments must be quoted so that the shell passes the option and any arguments as a single ARGV. For example, if the xyz option for converter Dg2Abc takes 'foo' and 'bar' as additional arguments, the command line would be: $ sgf2dg ... "-Abc-xyz foo bar" ... or a more realistic example of changing the background color: $ sgf2dg genan-shuwa -converter Tk "-Tk-bg #d2f1b4bc8c8b" Since Sgf2Dg is a super-set replacement for the Sgf2TeX package, TeX holds the default position for converters. Because of this historically priviledged position, the Dg2TeX options below do not need to be prepended with 'TeX-'. All of the following options apply to the Dg2TeX converter. Other plugins available at the time of release are Dg2Mp, Dg2ASCII, Dg2PDF, Dg2Ps, Dg2Tk and Dg2TkPs. Dg2ASCII and Dg2TkPs take no additional options. Dg2Tk doesn't explicitly accept options, but it attempts to pass unrecognized options to the Tk::Canvas widgets at creation time (which is why the example above works). For more information about converter-specific options, please refer to the perldoc or manual pages: $ perldoc Games::Go::Dg2PDF or $ man Games::Go::Dg2Ps Dg2TeX options -longComments (Dg2TeX) In its default usage, the comments to each diagram comprise an unbreakable vbox---they must all appear on one page. This can cause problems if the comments are very extensive. This option generates more complicated TeX macros which allow the comments to be broken across pages. This option may not be used with -simple or -longComments. -simple (Dg2TeX) This generates very simple TeX which may not look so good on the page, but is convenient if you intend to edit the TeX. This option should not be used with -longComments. -twoColumn (Dg2TeX) This generates a two-column format using smaller fonts. This option may not be used with -longComments or -coords. -bigFonts (Dg2TeX) Use fonts magnified 1.2 times. -texComments (Dg2TeX) If this option is NOT used then the characters {, } and found in comments are replaced by [, ] and /, since TeX roman fonts do not have these characters. If this option is used, these substitutions are not made, so you can embed TeX source (like {f change fonts}) directly inside the comments. -gap (Dg2TeX) The vertical gap (in points) between diagrams. Default is 12 points. SEE ALSO
o sgfsplit(1) - splits a .sgf file into its component variations AUTHOR
sgf2dg was written by Reid Augustin, <reid@hellosix.com> The GOOE fonts and TeX macros were designed by Daniel Bump (bump@math.stanford.edu). Daniel hosts the GOOE and sgf2dg home page at: L<http://match.stanford.edu/bump/go.html> COPYRIGHT AND LICENSE
Copyright (C) 1997-2005 by Reid Augustin This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA perl v5.10.1 2009-11-01 SGF2DG(1p)
All times are GMT -4. The time now is 03:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy