Sponsored Content
Top Forums UNIX for Advanced & Expert Users Copy a column to another column in UNIX fixedwidth file Post 302747255 by kiranparsha on Friday 21st of December 2012 01:35:16 AM
Old 12-21-2012
Thanks Ranga.... your command working fine and i redirected to new file.
Code:
awk -v ORS='' '{l=substr($0,0,1126);r=substr($0,1172,length($0));print l;printf("%-45s",substr($0,1678,4));print r,"\n";}' 121128120912_C0003109_GL1025.dtr > 121128120912_C0003109_GL10251.dtr

But in the original file when i press end it is showing as 3001 but in the new generated file it is showing as 3002. Please let me know what could be the reason.

thanks,
Kiran

Last edited by Scrutinizer; 12-21-2012 at 07:17 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

extracting/copy a column into a new column

Hello, Anybody out there knows how to copy a column data into a blank column using unix command? Thanks (1 Reply)
Discussion started by: folashandy
1 Replies

2. UNIX for Dummies Questions & Answers

copy column to another file

Hi guys, I want to use a quick one liner that can copy an entire column, and add it to a new file as another column. I've tried using cat, but that only appends my column to the bottom of the file. So now, my first file(file1) looks like this: 1995060101 8 1995060102 6 1995060102... (1 Reply)
Discussion started by: penlok
1 Replies

3. Shell Programming and Scripting

Changing one column of delimited file column to fixed width column

Hi, Iam new to unix. I have one input file . Input file : ID1~Name1~Place1 ID2~Name2~Place2 ID3~Name3~Place3 I need output such that only first column should change to fixed width column of 15 characters of length. Output File: ID1<<12 spaces>>Name1~Place1 ID2<<12... (5 Replies)
Discussion started by: manneni prakash
5 Replies

4. Shell Programming and Scripting

Copy the data column to adjacent column

Hi, i have file which contains only one record like below a|b|c|.... The no of columns is not known. The expected output is as below: a|a|b|b|c|c|... Please provide me your suggestions. OS: unix Thanks, Selva (7 Replies)
Discussion started by: bharathappriyan
7 Replies

5. UNIX for Dummies Questions & Answers

How to copy one columns and print to the last column in unix?

I want to copy column no 3 to the end of column example : alter table RECOVER_USR.MPULKIXD rename to alter table RECOVER_USR.CS_ADV_PROMO rename to alter table RECOVER_USR.BCH_HISTORY_TABLE rename to alter table BILLOPS.HISHAM_DATAPLUS_FINAL rename to alter table... (8 Replies)
Discussion started by: arifahel
8 Replies

6. Shell Programming and Scripting

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2 file 1 sample SNDK 80004C101 AT XLNX 983919101 BB NETL 64118B100 BS AMD 007903107 CC KLAC 482480100 DC TER 880770102 KATS ATHR 04743P108 KATS... (7 Replies)
Discussion started by: rydz00
7 Replies

7. UNIX for Dummies Questions & Answers

Copy column to another column in unix

Dear Gurus, I have a unix file 2 columns (# delimited) with the following data: ZTXX_CTBR1-ZBRAN1#ZTXX_CTBR1-ZBRAN_DESC# 01#CASH & CARRY# 02#DRUGSTORE - RX# 04#SUPERMARKET# 05#HYPERMARKET# 17#DRUGSTORE - NO RX# I would like to have a code that will do 2 things: 1. Delete the header... (16 Replies)
Discussion started by: chumsky
16 Replies

8. Shell Programming and Scripting

copy data from different file with some same column

I have file1 have below data ABCDE2012 ABCDE2012120 -099.8 -099.4 00.4 ABCDE2012 ABCDE2012124 -104.6 -103.6 01.0 ABCDE2012 ABCDE2012128 -104.4 -103.1 01.4 file2 ABCDE2012 ABCDE2012120 15.4 ABCDE2012 ABCDE2012124 18.5 ABCDE2012 ABCDE2012128 20.1 ABCDE2012 ABCDE2012122 0.5 ... (1 Reply)
Discussion started by: pareshkp
1 Replies

9. Shell Programming and Scripting

Copy column string and put in different column

Hello Here is my input: SU3902 SU3902A NS29C (10) (00) Q1J1 0 SU3902 SU3902B VLR05 (20) (02) Q2H1 4 SU3902 SU3902C NBR22 (30) (06) Q3R5 8 SU3904 SU39047 NSV19 (11) (09) Q4k6 2 SU3904 SU39048 LB231 (12) (05) Q5k1 6 SU3904 SU39049 11VLT (13) (08) Q10C1 10 SU3904 SU3904A 25R05 (15) (06)... (3 Replies)
Discussion started by: pareshkp
3 Replies

10. UNIX for Beginners Questions & Answers

How to copy a column of multiple files and paste into new excel file (next to column)?

I have data of an excel files as given below, file1 org1_1 1 1 2.5 100 org1_2 1 2 5.5 98 org1_3 1 3 7.2 88 file2 org2_1 1 1 2.5 100 org2_2 1 2 5.5 56 org2_3 1 3 7.2 70 I have multiple excel files as above shown. I have to copy column 1, column 4 and paste into a new excel file as... (26 Replies)
Discussion started by: dineshkumarsrk
26 Replies
Bio::Graphics::Glyph::fixedwidth(3pm)			User Contributed Perl Documentation		     Bio::Graphics::Glyph::fixedwidth(3pm)

NAME
Bio::Graphics::Glyph::fixedwidth - A base class fixed width glyphs SYNOPSIS
use Bio::Graphics; use Bio::Seq; use Bio::SeqFeature::Generic; my $bsg = 'Bio::SeqFeature::Generic'; my $seq = Bio::Seq->new(-length=>1000); my $whole = $bsg->new(-display_name => 'Clone82', -start => 1, -end => $seq->length); my $f1 = $bsg->new(-start => 100, -end => 300, -display_name => 'feature 1', ); my $f2 = $bsg->new(-start => 500, -end => 800, -display_name => 'feature 2', ); my $panel = Bio::Graphics::Panel->new(-length => $seq->length, -width => 800, -key_style => 'between', -pad_left => 10, -pad_right => 10, ); $panel->add_track($whole, -glyph => 'arrow', -double => 1, -tick => 2, -label => 1, ); $panel->add_track([$f1,$f2], -glyph => 'fixedwidth', -label => 1, -fixed_height => 20, -fixed_width => 20, -key => 'fixed width'); binmode STDOUT; print $panel->png; DESCRIPTION
This glyph is a base class for glyphs that wish to draw a fixed width content, such as an icon, image, scatterplot, and it would be inappropriate for the content to be stretched to match the start and end point of the associated feature. Instead the glyph draws a simple box spanning the feature's start:end region, two diagonal connecting lines, and then a fixed width rectangle beneath the box. This glyph does nothing very interesting itself. It is intended that subclasses should override the draw_contents() method to draw something interesting. See "Subclassing" for a simple example. OPTIONS The following options are standard among all Glyphs. See Bio::Graphics::Glyph for a full explanation. Option Description Default ------ ----------- ------- -fgcolor Foreground color black -outlinecolor Synonym for -fgcolor -bgcolor Background color turquoise -fillcolor Synonym for -bgcolor -linewidth Line width 1 -height Height of glyph 10 -font Glyph font gdSmallFont -connector Connector type 0 (false) -connector_color Connector color black -label Whether to draw a label 0 (false) -description Whether to draw a description 0 (false) -hilite Highlight color undef (no color) The following additional options are available to the "fixedwidth" glyph: Option Description Default ------ ----------- ------- -fixed_width Width of the content 0 -fixed_height Height of the content Same as -height -fixed_gap Vertical gap between the box 8 that shows the extent of the feature and the fixed-width content. If -fixed_gap is less than 8 then the diagonal connecting lines are not drawn. EXAMPLE SUBCLASS To draw something interesting in the fixed rectangle, override the draw_contents method. It takes four arguments consisting of the GD object, and the left, top, right and bottom coordinates of the fixed rectangle. Example: package Bio::Graphics::Glyph::fixedexample; use strict; use base 'Bio::Graphics::Glyph::fixedwidth'; sub draw_contents { my $self = shift; my ($gd,$left,$top,$right,$bottom) = @_; $self->unfilled_box($gd,$left,$top,$right,$bottom); $gd->line($left,$top,$right,$bottom,$self->fgcolor); $gd->line($left,$bottom,$right,$top,$self->fgcolor); } 1; This will draw the outline of the fixed rectangle. The rectangle will contain two diagonal lines. Not very interesting, but an example, nonetheless. See the stackedplot glyph for a more interesting subclass. BUGS AND LIMITATIONS
This glyph should used as the base for the image glyph, but isn't. This will be fixed. SEE ALSO
Bio::Graphics::Panel, Bio::Graphics::Glyph, Bio::Graphics::Glyph::arrow, Bio::Graphics::Glyph::cds, Bio::Graphics::Glyph::crossbox, Bio::Graphics::Glyph::diamond, Bio::Graphics::Glyph::dna, Bio::Graphics::Glyph::dot, Bio::Graphics::Glyph::ellipse, Bio::Graphics::Glyph::extending_arrow, Bio::Graphics::Glyph::generic, Bio::Graphics::Glyph::graded_segments, Bio::Graphics::Glyph::heterogeneous_segments, Bio::Graphics::Glyph::line, Bio::Graphics::Glyph::pinsertion, Bio::Graphics::Glyph::primers, Bio::Graphics::Glyph::rndrect, Bio::Graphics::Glyph::segments, Bio::Graphics::Glyph::ruler_arrow, Bio::Graphics::Glyph::toomany, Bio::Graphics::Glyph::transcript, Bio::Graphics::Glyph::transcript2, Bio::Graphics::Glyph::translation, Bio::Graphics::Glyph::triangle, Bio::DB::GFF, Bio::SeqI, Bio::SeqFeatureI, Bio::Das, GD AUTHOR
Lincoln Stein <lstein@cshl.org> Copyright (c) 2007 Cold Spring Harbor Laboratory This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty. perl v5.14.2 2012-02-20 Bio::Graphics::Glyph::fixedwidth(3pm)
All times are GMT -4. The time now is 04:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy