Sponsored Content
Top Forums Shell Programming and Scripting Multiple records based on ';' in the record Post 302515144 by panyam on Tuesday 19th of April 2011 08:23:53 AM
Old 04-19-2011
Code:
awk -F"|" '{s=gsub(":",":",$6); for(i=1;i<=s+1;i++) print $0}' OFS="|"  input_file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Record count based on a keyword in the records

Hi, Am having files with many records, i need to count and display the number of records based on the keyword in one of the column of the records. for e.g THE FILE CONTAINS TWO RECORDS LIKE. 200903031143150 0 1236060795054357lessrv1 BSNLSERVICE1 BSNLSERVICE1 ... (4 Replies)
Discussion started by: aemunathan
4 Replies

2. Shell Programming and Scripting

Parsing record into multiple records in Shell Script

Hi, I am trying to parse a very long record in a text file into multiple records by checking ADD, DELETE, or MODIFY field value in a shell script. Input # File name xyz.txt ADD|N000|8015662|DELETE|N001|9915662|MODIFY|N999|85678 Output ADD|N000|8015662| DELETE|N001|9915662|... (8 Replies)
Discussion started by: naveed
8 Replies

3. Shell Programming and Scripting

Multiple records based on :

Hi , I have the below source source data 1|2|3|:123:abc|4 1|2|a| | 5 1|2|3|4|:a:s:D.....:n|t Target data should be 1|2|3|:123:abc|4 1|2|3|:123:abc|4 1|2|a| | 5 1|2|3|4|:a:s:D.....:n|t 1|2|3|4|:a:s:D.....:n|t 1|2|3|4|:a:s:D.....:n|t 1|2|3|4|:a:s:D.....:n|t (3 Replies)
Discussion started by: mora
3 Replies

4. Shell Programming and Scripting

Split a single record to multiple records & add folder name to each line

Hi Gurus, I need to cut single record in the file(asdf) to multile records based on the number of bytes..(44 characters). So every record will have 44 characters. All the records should be in the same file..to each of these lines I need to add the folder(<date>) name. I have a dir. in which... (20 Replies)
Discussion started by: ram2581
20 Replies

5. UNIX for Dummies Questions & Answers

Split single record to multiple records

Hi Friends, source .... col1,col2,col3 a,b,1;2;3 here colom delimeter is comma(,). here we dont know what is the max length of col3 means now we have 1;2;3 next time i will receive 1;2;3;4;5;etc... required output .............. col1,col2,col3 a,b,1 a,b,2 a,b,3 please give me... (5 Replies)
Discussion started by: bab.galary
5 Replies

6. Shell Programming and Scripting

Splitting record into multiple records by appending values from an input field (AWK)

Hello, For the input file, I am trying to split those records which have multiple values seperated by '|' in the last input field, into multiple records and each record corresponds to the common input fields + one of the value from the last field. I was trying with an example on this forum... (4 Replies)
Discussion started by: imtiaz99
4 Replies

7. Shell Programming and Scripting

Multiple Records from 1 Record

I need to make one record to multiple records based on occurence column in the record and change the date.For example below first record has 5 ,so need to create 5 records from one and change the date to 5 months.Occurence can be any number. I am unable to come with a script.Can some one help ... (5 Replies)
Discussion started by: traininfa
5 Replies

8. Shell Programming and Scripting

Merge records based on multiple columns

Hi, I have a file with 16 columns and out of these 16 columns 14 are key columns, 15 th is order column and 16th column is having information. I need to concate the 16th column based on value of 1-14th column as key in order of 15th column. Here are the example file Input File (multiple... (3 Replies)
Discussion started by: Ravi Agrawal
3 Replies

9. Shell Programming and Scripting

How to split one record to multiple records?

Hi, I have one tab delimited file which is having multiple store_ids in first column seprated by pipe.I want to split the file on the basis of store_id(separating 1st record in to 2 records ). I tried some more options like below with using split,awk etc ,But not able to get proper output. can... (1 Reply)
Discussion started by: jaggy
1 Replies

10. UNIX for Dummies Questions & Answers

Display latest record from file based on multiple columns combination

I have requirement to print latest record from file based on multiple columns combination. EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/16/2015 100004 03/16/2015 100005 001 EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/18/2015 140003 03/18/2015 140004 001 EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/18/2015 220006... (1 Reply)
Discussion started by: tmalik79
1 Replies
BALLS(1)						      General Commands Manual							  BALLS(1)

NAME
balls - preprocessor for space-filling models in Raster3D molecular graphics package SYNOPSIS
balls [-h] Balls reads a file describing atom colours and/or a PDB coordinate file and produces a file containing Raster3D descriptor records for each atom in the input file. The file produced by balls may be fed directly to render or it may be combined with descriptor files produced by other Raster3D utilities. EXAMPLES
To describe a simple space-filling model coloured by residue type: cat mycolours.pdb protein.pdb | balls | render > mypicture.png To include a pre-selected view matrix with the same model: cp view1.matrix setup.matrix cat mycolours.pdb protein.pdb | balls | render > mypicture.png To prepend header records describing a pre-selected scale and view: cat mycolours.pdb protein.pdb | balls -h > balls.r3d cat header.r3d balls.r3d | render > mypicture.png OPTIONS
-h Suppress header records in output. By default balls 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 so that the output file contains only sphere descrip- tors. 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. DESCRIPTION
The input to balls consists of a single text file containing colour information and atomic coordinates in PDB data bank format. Coordi- nates are output as Raster3D descriptor records with colours and sphere radii assigned according to the COLO records described below. By default atoms are assigned CPK colours. By default the output file contains a set of header records as required by the render program. The header is constructed to include a TMAT matrix corresponding to the transformation matrix contained in file setup.matrix (if it exists), or to the Eulerian angles contained in file setup.angles (if it exists). Colours are assigned to atoms using a matching process, using COLOUR records prepended to the input PDB file. Raster3D uses a pseudo-PDB record type with with COLO in the first 4 columns: Columns 1 - 4 COLO 7 - 30 Mask (described below) 31 - 38 Red component 39 - 46 Green component 47 - 54 Blue component 55 - 60 van der Waals radius in Angstroms 61 - 80 Comments Note that the Red, Green, and Blue components are in the same positions as the X, Y, and Z components of an ATOM or HETA record, and the van der Waals radius goes in place of the Occupancy. The Red, Green, and Blue components must all be in the range 0 to 1. The Mask field is used in the matching process as follows. First the program reads in and stores all the ATOM, HETA, and COLOUR records in input order. Then it goes through each stored ATOM/HETA record in turn, and searches for a COLOUR record that matches the ATOM/HETA record in all of columns 7 through 30. The first such COLOUR record to be found determines the colour and radius of the atom. In order that one COLOUR record can provide colour and radius specifications for more than one atom (e.g., based on residue or atom type, or any other criterion for which labels can be given somewhere in columns 7 through 30), the "#" symbol is used as a wildcard. I.e. a # in a COLOUR record matches any character in the corresponding column in an ATOM or HETA record. All other characters must match literally to count as a match. Note that the very last COLO record in the input should have # symbols in all of columns 7 through 30 in order to pro- vide a colour for any atom whose ATOM/HETA record fails to match any previous COLOUR record. This idea of matching masks for colour speci- fications is due to Colin Broughton. Several files of COLOUR records, including one based on Bob Fletterick's "Shapely Models" and another mimicking CPK model parts, are pro- vided as samples. ENVIRONMENT
The files setup.matrix and setup.angles, if they exist, affect the header records produced by balls. SOURCE
anonymous ftp site: ftp.bmsc.washington.edu 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
render(l), rods(l), ribbon(l) AUTHORS
Originally written by David J Bacon and Wayne F Anderson. Extensions and revisions by Ethan A Merritt. Raster3D 8 May 1999 BALLS(1)
All times are GMT -4. The time now is 10:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy