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)
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 (6 Replies)
Hello,
I have a question regarding the awk command. Here is the line I need to grep:
1 F= -.13250138E+03 E0= -.13249556E+03 d E =-.174650E-01 mag= 35.2157
Instead of displaying the number in red I would like to store it as a variable such as X. Is there a way to do this? Thanks for any... (3 Replies)
Hi, guys. I have one question:
I need to search for a string in a file, and then extract another string from the file and assign it to a variable.
For example:
the contents of the file (group) is below:
...
ftp:x:23:
mail:x:34
...
testing:x:2001
sales:x:2002
development:x:2003
...... (6 Replies)
I need to extract certain pieces from a string, wher delimiters may vary. For example
A0 B0 C0 12345677 X0 Y0 Z0
A1-B1 C1 12345678 X1 Y0 Z0
A1/B2 C77 12345679 X2 Y0 Z0
I need to get
C0 12345677 X0
C1 12345678 X1
C77 12345679 X2
I tried sed, see example below:
echo 'A0 B0... (2 Replies)
Hi,
I'm trying to search a text file for a string: "energy(sigma->0)=". To do so, I executed the grep command, which returned many matches, for example:
energy without entropy = -112.16486170 energy(sigma->0) = -112.16520778
energy without entropy = -112.16488936 ... (5 Replies)
sorry i'm newbies c programer
how to store string to variable with value flexible.
example
int hh=1; ---> value flexible 1,2,3,4,5;
int xx=1; ---> value flexible 1,2,3,4,5;
char test="value=%d and value=%d",hh,xx; --> not working
char test2="value2=%d and value2=%d",hh,xx; --> not... (1 Reply)
I have a file with
<suit:run date="Trump Tue 06/19/2012 11:41 AM EDT" machine="garg-ln" build="19921" level="beta" release="6.1.5" os="Linux">
Need to find word "build" then
extract build number, which is 19921 also
release number, which is 6.1.5 then
concatenate them to one variable as... (6 Replies)
Hi,
I'm doing a script to list all scripts called by a "master" script.
But I have an issue as there is some variables in the name of the called scripts.
Example:
% cat master_script.sh
ENVIR=PROD
VERSION=1.2
/users/maturix/$ENVIR/program_$VERSION.shI would like my script displays a kind... (7 Replies)
Hi ,
I have an file like below ,
cat input.txt
'Pattern2' => 'blahdalskdahdlahldahdlakhdlahdlkajdlkaadasdadadadadadadasda
ajlalnalndklandlaksdlkaddd'
'Pattern2' => 'aohaonalkndlanldandlandklasnldnaldnak'
............
........
.....
Here is what am trying to do ,
I want to grep for... (3 Replies)
Discussion started by: scott_cog
3 Replies
LEARN ABOUT CENTOS
image::info::xbm
Image::Info::XBM(3) User Contributed Perl Documentation Image::Info::XBM(3)NAME
Image::Info::XBM - XBM support for Image::Info
SYNOPSIS
use Image::Info qw(image_info dim);
my $info = image_info("image.xbm");
if (my $error = $info->{error}) {
die "Can't parse image info: $error
";
}
my $color = $info->{color_type};
my($w, $h) = dim($info);
DESCRIPTION
This modules supplies the standard key names except for Compression, Gamma, Interlace, LastModificationTime, as well as:
HotSpotX
The x-coord of the image's hotspot. Set to -1 if there is no hotspot.
HotSpotY
The y-coord of the image's hotspot. Set to -1 if there is no hotspot.
L1D_Histogram
Reference to an array representing a one dimensioanl luminance histogram. This key is only present if "image_info" is invoked as
"image_info($file, L1D_Histogram=>1)". The range is from 0 to 1.
METHODS
process_file()
$info->process_file($source, $options);
Processes one file and sets the found info fields in the $info object.
AUTHOR FILES
This module requires Image::Xbm
SEE ALSO
Image::Info, Image::Xbm
NOTES
For more information about XBM see <http://www.martinreddy.net/gfx/2d/XBM.txt>.
AUTHOR
Jerrad Pierce <belg4mit@mit.edu>/<webmaster@pthbb.org>
Tels - (c) 2006
Current maintainer: Slaven Rezic <srezic@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.16.3 2009-11-22 Image::Info::XBM(3)