Sponsored Content
Special Forums UNIX Desktop Questions & Answers copy content of file to another Post 302573650 by kanikasharma on Tuesday 15th of November 2011 07:18:32 AM
Old 11-15-2011
copy content of file to another

I have a file called part1.pdb...contents are:
Code:
ATOM      1  N   SER     1     -10.295  -8.909  10.913  1.00  0.00
ATOM      2  H1  SER     1     -10.230  -8.214  10.183  1.00  0.00
ATOM      3  H2  SER     1      -9.558  -8.745  11.584  1.00  0.00
ATOM      4  H3  SER     1     -11.255  -8.966  11.222  1.00  0.00

Now there are several files with name File9_60.pdb, File8_240.pdb etc...
I have to copy content of part1.pdb into each file. i wote a code in perl but this doesnot work...can some1 help..??
Code:
#!/usr/bin/perl -w

use strict;

my @filenames = qw(part1.pdb);

for my $filename (@filenames) {

    open(my $fr, '<', $filename) or next;
    open(my $fw, '>>', grep {/File\d+_\d+/} glob "File*_*.pdb") or next;

    local($/) = undef;
    my $content = <$fr>;

    print $fw $content;

    close $fr;
    close $fw;
}


Moderator's Comments:
Mod Comment Please use code tags!

Last edited by zaxxon; 11-16-2011 at 09:08 AM.. Reason: code tags, see PM
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do I search first&second string & copy all content between them to other file?

Hi All, How do I search first string & second string and copy all content between them from one file to another file? Please help me.. Thanks In Advance. Regards, Pankaj (12 Replies)
Discussion started by: pankajp
12 Replies

2. Shell Programming and Scripting

How to copy Content of a file to another file on a specific column

Hi i have a file (file1)with this content: 1.2.3.10.in-addr.arpa and a second file (file2) with a content wich have 8 Columns if a do a awk '{print $8}' file2 i become this output: ,'10.3.2.1.', So i want to replace only the 10.3.2.1. in file2 (column 8) with the information... (8 Replies)
Discussion started by: tuxus
8 Replies

3. UNIX for Dummies Questions & Answers

copy content of file to other file

Hi , i Have 11 Gb file which contain 70 database but I want only one database now i want content of file copy to other file as from starting from word of file1 create database xyz to end word create database xyz1 this copies to other file2 By this I cant get required database... (2 Replies)
Discussion started by: kaushik02018
2 Replies

4. UNIX for Dummies Questions & Answers

How to copy entire file content into another file being in last line mode of vi ?

How to copy entire file content into another file being in last line mode of vi ? ---------- Post updated at 10:07 AM ---------- Previous update was at 09:56 AM ---------- Got it : :1,30w file.txt (1 Reply)
Discussion started by: presul
1 Replies

5. Shell Programming and Scripting

copy content of file to another files from certain position

Hello Guys I have a directory of xml files (almost 500 ) Now in each xml file 3 new attributes will be added which are in a different single file Is there any way I can copy the whole content of single file at 6th line of all the files in the directory . Thanks a lot!!! (7 Replies)
Discussion started by: Pratik4891
7 Replies

6. Shell Programming and Scripting

How to copy mail content in a file in Unix

Hi Guys I want to write a script which search mail with subject line and after that I want the mail content in a file please help guys. Thanks Atul Singh (3 Replies)
Discussion started by: atul9806
3 Replies

7. Shell Programming and Scripting

Copy content of multiple sh's into one

Hi, I got the following problem. I got a folder called "renapple" whose content has multiple ".sh" files in it: they all contain one line of text: (this is just an example, the content itself looks different). cp path1/file path2 What I want to do is: - copy the content of all... (19 Replies)
Discussion started by: pasc
19 Replies

8. Shell Programming and Scripting

Change the file name and copy old file content to new file names.

Hi, I have a files in a directory as below :- ls -1 mqdepth-S1STC02 proc-mq-S1STC01 proc-mq-S1STC02 proc-mq-S1STC03 Whereever i have S1STC i need to copy them into new file with file name S2STC. expected output :- ls -1 mqdepth-S2STC02 proc-mq-S2STC01 proc-mq-S2STC02... (3 Replies)
Discussion started by: satishmallidi
3 Replies

9. Shell Programming and Scripting

Copy content of file in different file

Dear all, I get a file which is probably in hexadecimal character which i have to load in oracle. oracle is unable to process the original file but when i copy the content into notepad it works fine. How can i achieve in unix to copy content of file into .txt file instead of cp command as cp... (23 Replies)
Discussion started by: guddu_12
23 Replies

10. UNIX for Beginners Questions & Answers

Copy the content from txt file and create a html file

I have a txt file with a list of error messages in a xml tag format, and each error message is separated with a identifier(endresult).Need to split that and copy and create a new html file.Error message has some special character. how to escape the special character and insert my data into the... (7 Replies)
Discussion started by: DevAakash
7 Replies
RASTEP(1)						      General Commands Manual							 RASTEP(1)

NAME
rastep - (Raster3D Thermal Ellipsoid Program) SYNOPSIS
rastep [-h] [-iso] [-Bcolor Bmin Bmax] [-prob Plevel] [-fancy[0-3]] [-radius R] < infile.pdb > ellipsoids.r3d rastep -tabulate [tabfile] [-by_atomtype] [-com [comtabfile]] < infile.pdb > statistics.text Rastep reads a PDB coordinate file. This file must contain ANISOU records describing atoms refined anisotropically. Rastep can either create an input file for the Raster3D render program or perform a statistical analysis of the atomic anisotropy for various classes of input atoms. By default the program creates an ellipsoid+stick scene description in which each atom is represented by an ellipsoid enclosing an isosurface of the probability density function. These are commonly known as thermal ellipsoids. The program can be run in an alternate mode, controlled by the -tabulate option, in which the primary output to stdout is a list of the Ei- genvalues of the Uij matrix, followed by the corresponding atomic anisotropy and isotropic Ueq, for each atom in the input file with both an ATOM record and a matching ANISOU record. This mode is used by the validation tools Parvati and Skittls. EXAMPLES
To describe thermal ellipsoids at the 50% probability level, with default CPK colors, and send it for immediate rendering into a PNG file rastep < infile.pdb | render -png picture.png To describe the same ellipsoids colored by Biso, omiting header records so that the resulting input file can be merged with other scene components rastep -h -Bcolor 10. 30. < infile.pdb > ellipsoids.r3d cat header.r3d ellipsoids.r3d otherstuff.r3d | render > picture.png OPTIONS
-auto Auto-selection of viewing angle, chosen to minimize the spread of the atoms along the view direction. -Bcolor Bmin Bmax Assign colors based on B values rather than mathcing ATOM records against input or default COLOUR records. Atoms with B <= Bmin will be colored dark blue; atoms with B >= Bmax will be colored light red; atoms with Bmin < B < Bmax will be assigned colors shading smoothly through the spectrum from blue to red. -fancy[0-6] The -fancy option selects increasingly complex representations of the rendered ellipsoids. -fancy0 [default] = solid surface -fancy1 = principal axes of ellipsoid, with transparent bounding surface -fancy2 = colored equatorial planes of the ellipsoid -fancy3 = colored equatorial planes with transparent bounding surface -fancy4 = transparent bounding surface containing longest principle axis -fancy5 = for ORTEP lovers, a solid ellipsoid with one octant missing -fancy6 = for ORTEP lovers who want the missing octant in a separate color -h Suppress header records in output. By default rastep will produce an output file which starts with header records containing a default set of scaling and processing options. The -h flag will suppress these header records. This option is useful for producing files which describe only part of a scene, and which are to be later combined with descriptor files produced by other programs. -iso Force isotropic probability surfaces (spheres). By default rastep will look for ANISOU records in the PDB file and use these to generate ellipsoids. If no ANISOU record is present for a given atom, the B value given in the ATOM/HETATM record will be used to generate a sphere instead. Selecting the -iso option will force the program to use the B value in the ATOM record even if an ANISOU record is also present. -mini Auto-orientation (as in -auto) and small size plot (176x208). -nohydrogens Do not plot hydrogens, even if present in PDB file. -prob Plevel By default, isosurfaces are drawn to enclose the 50% probability level in the density function described by the Uij values in the ANISOU record. The -prob option allows you to select a different probability level instead. If 0 < Plevel < 1 this value is interpreted as a fraction; if Plevel > 1 this value is interpreted as a percent. -radius R By default, rastep draws bonds with radius 0.10A between neighboring atoms using the same algorithm as rods. This option allows you to change the radius of the bonds. If the radius is set to 0 no bonds are drawn. -tabulate [tabfile] The -tabulate option requests that the program accumulate and print statistics on the distribution of anisotropy among atoms in the input file rather than producing an input file for render. The principle axes and anisotropy of each atom are written to stdout. An overall sta- tistical summary is written to tabfile if specified, otherwise to stdout. -by_atomtype The -by_atomtype option is a modifier to -tabulate. It causes a further subdivision of atoms by atom type in the preparation of statistical summaries. Atom types are taken from columns 77:78 of the PDB ATOM records. -com [comtabfile] Tabulate distribution of anisotropy in shells by distance from center-of-mass. Output to comtabfile if specified, otherwise to stdout. NOTES
There is little, if any, consistency in format among the various programs which write out anisotropic displacement parameters. This program interprets the Uij values in the order specified for ANISOU records in PDB format. That is, columns 29-70 of the PDB record are inter- preted as integers representing 10000 * Uij, in the order U11 U22 U33 U12 U13 U23. Note in particular that the order of the cross-terms is not the same as that used by ORTEP or shelx, neither of which use PDB format anyway. However, the program shelxpro will produce correctly formatted PDB records from a shelx coordinate file. SOURCE
web URL: http://www.bmsc.washington.edu/raster3d/raster3d.html contact: Ethan A Merritt University of Washington, Seattle WA 98195 merritt@u.washington.edu SEE ALSO
raster3d(l), render(l) AUTHORS
Ethan A Merritt. Raster3D 14 Dec 2010 RASTEP(1)
All times are GMT -4. The time now is 02:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy