Sponsored Content
Top Forums Shell Programming and Scripting How can use the perl or other command line to calculate the length of the character? Post 302279122 by patrick chia on Thursday 22nd of January 2009 02:58:25 AM
Old 01-22-2009
How can use the perl or other command line to calculate the length of the character?

For example, if I have the file whose content are:
>HWI-EAS382_30FC7AAXX:7:1:927:1368
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
>HWI-EAS382_30FC7AAXX:7:1:924:1373
ACGAACTTTAAAGCACCTCTTGGCTCGTATGCCGTC

I want my output calculate the total length of nucleotide. So my output should look like this:
>HWI-EAS382_30FC7AAXX:7:1:927:1368
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 36
>HWI-EAS382_30FC7AAXX:7:1:924:1373
ACGAACTTTAAAGCACCTCTTGGCTCGTATGCCGTC 36

Thanks for all of your advice. Have a nice day.
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Building command line parameters of arbitrary length

I couldn't find an existing thread that addressed this question, so hopefully this isn't redundant with anything previously posted. Here goes: I am writing a C-Shell script that runs a program that takes an arbitrary number of parameters: myprog -a file1 \ -b file2 \ -c file3 ... \ -n... (2 Replies)
Discussion started by: cmcnorgan
2 Replies

2. UNIX for Dummies Questions & Answers

what is the maximum length of th os-command line in Unix.

Hi All, I didn't find any thread that match this question so I hope it's not redundant. I am totally new to Unix. I want to know what is the maximum length of the os-commandline in Unix. Will it cause any problem if I run any application whose total path length is much longer than 256... (2 Replies)
Discussion started by: kumardesai
2 Replies

3. Solaris

Calculate the length and add some string infront

Hi all, I have file having 4 coulmn like 9246309198,406655682,400009246309198 9246309198,9246309198,400009246309198 9246309198,9246309198,400009246309198 9246309198,9246309198,400009246309198 9246309198,406655682,400009246309198 9246309198,9246309198,400009246309198 I want to valid... (4 Replies)
Discussion started by: salaathi
4 Replies

4. Shell Programming and Scripting

How can I calculate the total of nucleotide in Unix?What command line I should type?

For example, if I have the file whose content are: >HWI-EAS382_30FC7AAXX:7:1:927:1368 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA >HWI-EAS382_30FC7AAXX:7:1:924:1373 ACGAACTTTAAAGCACCTCTTGGCTCGTATGCCGTC I want my output calculate the total of nucleotide. So my output should look like this:... (2 Replies)
Discussion started by: patrick chia
2 Replies

5. Shell Programming and Scripting

perl file, one line code include "length, rindex, substr", slow

Hi Everyone, # cat a.txt a;b;c;64O a;b;c;d;ee;f # cat a.pl #!/usr/bin/perl use strict; use warnings; my $tmp3 = ",,a,,b,,c,,d,,e,,f,,"; open(my $FA, "a.txt") or die "$!"; while(<$FA>) { chomp; my @tmp=split(/\;/, $_); if ( ($tmp =~ m/^(64O)/i) || ($tmp... (3 Replies)
Discussion started by: jimmy_y
3 Replies

6. Shell Programming and Scripting

Calculate the length of the each variable and matches to the desired value

My script is currently doing two function and I want to add one more as pre the question. echo -en "Enter the logmsg=" read logmsg logmsg1=${logmsg%%|*}; logmsg_len2=$(echo ${logmsg} | awk '{print $2}'); logmsg_suffix="|"; Char() { #echo $logmsg1 echo $logmsg1 | tr ',' '\n' | awk... (4 Replies)
Discussion started by: rohit22hamirpur
4 Replies
MBKPS(3)						       MBK UTILITY FUNCTIONS							  MBKPS(3)

NAME
mbkps - mbk process state ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr SYNOPSYS
#include "mut.h" void mbkps() DESCRIPTION
mbkps does some functions calls and gathers informations about time and memory spend during a program run. encouraged. EXAMPLE
#include "mut.h" #include "mlo.h" lofig_list *check_flat(pt) lofig_list *pt; { mbkps(); pt = rflattenlofig(pt, YES, NO); mbkps(); return pt; } that would output something like : mbk stats : 1 call user time : 0 sec system time : 0 sec real size : 504 k mbkalloc peak size : 68 k mallinfo size : 96 k mbk stats : 2 call user time : 1 sec system time : 0 sec real size : 924 k mbkalloc peak size : 2560 k mallinfo size : 512 k SEE ALSO
mbk(1), getrusage(3), mallinfo(3V). BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. ASIM
/LIP6 October 1, 1997 MBKPS(3)
All times are GMT -4. The time now is 06:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy