08-14-2008
Zaxxon,
Thanks for your help.
Yes I understand the principal of splitting the string based on a given field seperator and placing each new field in an array.
My problem is that my string contains no field seperators.
From your example how would you split if the string contained no ":" and was simply aabbccddee.
I would like to assign each letter of the string to a place in the array.
Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a string like 'xyz' and i want to to split the above string into letters for comparision purpose.
any idea pls.
cheers
RRK. (3 Replies)
Discussion started by: ravi raj kumar
3 Replies
2. Shell Programming and Scripting
Hi,
I am new to shell scripting, Can any body suggest me how I can split a string with a delimiter as whitespace into words and store into a array.
I have read a line from file, now I want to split the line into words and store in a array for further use.
eg : the sky is blue
want... (3 Replies)
Discussion started by: smk
3 Replies
3. Programming
Hello,
I am recently working on an application that sends large strings accross a network very often. These then need to be broken up first with '!' and then with ','. My current function (below) works fine for this when not too much data is being sent across the network but segfaults when a... (4 Replies)
Discussion started by: kpedersen
4 Replies
4. Shell Programming and Scripting
Let's say I have a very long string with no spaces but just words stored in $very_long_string.
$very_long_string = "aaaaaaaaaaabbbbbbbbbbbccccccccccccdddddddddddd";
I can do this to split the string into 1 character each and store them in an array:
@myArray = split(//, $very_long_string); ... (3 Replies)
Discussion started by: teiji
3 Replies
5. UNIX for Dummies Questions & Answers
Hello all!
I'm trying to put together a small script that will take in a file name and attach a datestamp to the end of it (but before the file type extension).
To illustrate...
Before:
filename.txt
anotherfilename.txt
After:
filename_20090724.txt
anotherfilename_20090724.txt
... (7 Replies)
Discussion started by: jisoo411
7 Replies
6. Shell Programming and Scripting
Hi,
I have a string like this in a file,
I want to retrive the words separated by comma's in 3 variables. like
How do i get that.plz advice (2 Replies)
Discussion started by: suresh_kb211
2 Replies
7. UNIX for Dummies Questions & Answers
Hello I need help with the following. I have strings like
#if defined(__def1__)
#if defined(__def1__) || defined(__def2__)
#if defined(__def1__) && defined(__def2__) && defined(__def3__).
#if defined(__def1__) || defined(__def2__) || defined(__def3__).
I need to print what is there in... (4 Replies)
Discussion started by: srk
4 Replies
8. Shell Programming and Scripting
Input:
Debris Linux is a minimalist, desktop-oriented distribution and live CD based on Ubuntu.
It includes the GNOME desktop and a small set of popular desktop applications, such
as GNOME Office, Firefox web browser, Pidgin instant messenger, and ufw firewall manager.
Debris Linux ships... (5 Replies)
Discussion started by: cola
5 Replies
9. Shell Programming and Scripting
Hi ,
can someone help me how to make an AWK code for splitting a string of equal parts of 500 chars in while loop?
Thank you! (4 Replies)
Discussion started by: sanantonio7777
4 Replies
10. Shell Programming and Scripting
Hi Experts.
I'm stuck with the below AWK code where i'm trying to move the records containing any special characters in the last field to a bad file.
awk -F, '{if ($NF ~ /^|^/) print >"goodfile";else print >"badfile"}' filename
sample data
1,abc,def,1234,A *
2,bed,dec,342,* A ... (6 Replies)
Discussion started by: shell_boy23
6 Replies
LEARN ABOUT DEBIAN
tangram::type::array::scalar
Tangram::Type::Array::Scalar(3pm) User Contributed Perl Documentation Tangram::Type::Array::Scalar(3pm)
NAME
Tangram::Type/Array/Scalar - map Perl array of strings or numbers
SYNOPSIS
use Tangram::Core;
use Tangram::Type/Array/Scalar; # always
$schema = Tangram::Schema->new(
classes => { NaturalPerson => { fields => {
flat_array =>
{
interests =>
{
table => 'NP_int',
sql => 'VARCHAR(50)',
},
lucky_numbers => 'int', # use defaults
}
DESCRIPTION
Maps references to a Perl array. The persistent fields are grouped in a hash under the "array" key in the field hash.
The array may contain only 'simple' scalars like integers, strings or real numbers. It may not contain references. For arrays of objects,
see Tangram::Type::Array::FromMany and Tangram::Type::Array::FromOne.
Tangram uses a table to save the state of the collection. The table has three columns, which contain
* the id of the container object
* the position of the element in the array
* the value of the element
The field names are passed in a hash that associates a field name with a field descriptor. The field descriptor may be either a hash or a
string. The hash uses the following fields:
* type
* table
* sql
Optional field "type" specifies the type of the elements. If the type is "string"Tangram quotes the values as they are passed to the data-
base. Not specifying a "type" is exactly equivalent to specifying "string".
Optional field "table" sets the name of the table that contains the elements. This defaults to 'C_F', where C is the class of the contain-
ing object and F is the field name.
Optional field "sql" specifies the type that deploy() (see Tangram::Deploy) should use for the column containing the elements. If this
field is not present, the SQL type is derived from the "type" field: if "type" is "string" (or is absent) VARCHAR(255) is used; otherwise,
the "type" field is interpreted as a SQL type.
If the descriptor is a string, it is interpreted as the value of the "type" field and all the other fields take the default value.
perl v5.8.8 2006-03-29 Tangram::Type::Array::Scalar(3pm)