11-12-2007
Extract numbers from a string and store in variables
Hi All,
Is it possible in Unix shell script to extract numbers from a string containing ".", such as;
5.2.314
And store in variables so;
var1 = 5
var2 = 2
var3 = 314
Thanks in advance for any help anyone can provide
dave
8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a variable which consists of a string like this:
001 aaabc 44 a bbb12
How do I extract each substring, delimited by the spaces, into new variables - one for each substring?
eg var1 will be 001, var2 will be aaabc, var3 will be 44, var4 will be a, etc?
I've come up with this:... (2 Replies)
Discussion started by: Sniper Pixie
2 Replies
2. Solaris
Hi all,
I have doubt can array in a shell script can store floating point numbers. i have tired. but i unable to work it out.
Please help me regarding this
Thank U
Naree (1 Reply)
Discussion started by: naree
1 Replies
3. UNIX for Dummies Questions & Answers
im looping through an array setting three variables each time (one of the variables gives me the position in the array and is incremented each loop)
im trying to then set the variables to that position in the array without much luck. any ideas?
anArray=`$VAR1+$VAR2+"("$pos")"` (1 Reply)
Discussion started by: magnia
1 Replies
4. Shell Programming and Scripting
Hi everyone, I am having some problems with my scripts so I hope you could help me.
I am trying to store the result of a division in a variable in tcshell but I have the problem that if:
For example, dividing 2/100 the result is 0.02 but if I store that I have "0".
How can I have 0.02... (8 Replies)
Discussion started by: Bloody
8 Replies
5. Shell Programming and Scripting
Guys anyone know how i can store fields into multiple variables in one go?
I'm wanting to grab the disk id's from format into disk1 and disk2
Below is what i want to work but i know it doesnt :-
: | format | awk '/^(\ +)/ {print $2}' | read disk1 disk2
The below does work...but i don't... (5 Replies)
Discussion started by: lavascript
5 Replies
6. Shell Programming and Scripting
I have a for loop that cycles twice and generates 1 random number for each pass through. I would like to be able to store the two numbers to use later for arithmetics. Is there a way to do that? Right now I can only seem to use the last random number for anything. Thanks. (4 Replies)
Discussion started by: AxlVanDamme
4 Replies
7. Shell Programming and Scripting
Hi,
I've a file ImageSizeDetails.txt with the following contents:
Image Name: swncd 01.10.00.04
Created: Wed Jan 9 14:05:48 2013
Image Type: ARM Linux Multi-File Image (gzip compressed)
Data Size: 7351011 Bytes = 7178.72 kB = 7.01 MB
Load Address: 00008000
Entry Point: ... (6 Replies)
Discussion started by: Parameswaran
6 Replies
8. Shell Programming and Scripting
Hi Experts
I need your help to optimize my script to execute better as I have nearly 1M records & the script is taking close to 40 minutes to execute, so would need support on a faster alternative.
Input: file
{"house":"1024","zip":"2345","city":"asd","country":"zzv"}... (2 Replies)
Discussion started by: nk1984
2 Replies
LEARN ABOUT DEBIAN
seqsplit
SEQSPLIT(1) General Commands Manual SEQSPLIT(1)
NAME
seqsplit - split seqs into chunks of defined size and overlap
SYNOPSIS
seqsplit [-options] <seqfile>
DESCRIPTION
This manual page documents briefly the seqsplit command.
seqsplit is a program that splits sequences into smaller chunks of defined size and overlap; output a FASTA file.
OPTIONS
-h Help; display usage and version.
-o <file>
Output the new FASTA file to <file>.
--fragfile <f>
Save one-line-per-frag coord summary file to <f>.
--informat <s>
Specify sequence file format <s>.
--length <n>
Set max length of each unique seq frag to <n>.
--overlap <n>
Set overlap length to <n> (total frag size = length+overlap).
--shortnames
Use short "frag1" names, not "<src>/<from>-<to>".
LIMITATIONS
Still working in 32 bits -- no sequence can be more than 2 GB in size.
SEE ALSO
afetch(1), alistat(1), compalign(1), compstruct(1), revcomp(1), seqstat(1), sfetch(1), shuffle(1), sindex(1), sreformat(1), stranslate(1),
weight(1).
AUTHOR
Sean Eddy
HHMI/Department of Genetics
Washington University School of Medicine
4444 Forest Park Blvd., Box 8510
St Louis, MO 63108 USA
Phone: 1-314-362-7666
FAX : 1-314-362-2157
Email: eddy@genetics.wustl.edu
This manual page was written by Nelson A. de Oliveira <naoliv@gmail.com>,
for the Debian project (but may be used by others).
Mon, 01 Aug 2005 15:28:08 -0300 SEQSPLIT(1)