×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Convert a String to 2D array and Operate their values

## Convert a String to 2D array and Operate their values

(OP)
Convert String to Array then do basic operations:

StringSource= (A1,B2,C1; A2,B2,C1; A3,B2,C2; A4,B2,C2;A5,B2,C3; A6,B2,C4; A7,B2,C5;)

to

2DArray = {A1,B1,C1; A2,B2,C2; A3,B3,C3; A4,B4,C4 ; A5,B5,C5; A6,B6,C6; A7,B7,C7}

using Split "," For Axis-X and ";" for Axis-Y and not sure that more do.

how can I do arithmetic operations 2DArray like this :

((2DArray(0)(0)*2DArray(0)(1))/2DArray(0)(2))+((2DArray(1)(0)*2DArray(1)(1))/2DArray(1)(2))+ ((2DArray(3)(0)*2DArray(3)(1))/2DArray(3)(2))+ ... etc

where:
if 2DArray(X)(2) is blank = "1"
if 2DArray(X)(1) is blank = "1"
if 2DArray(X)(0) is blank = "0"

RESULT = (A1 * B1 / C1) + ...

### RE: Convert a String to 2D array and Operate their values

Hi jtm2020hyo,

You can store your string components in 2D-array which elements are addressed as A(i,j) or you can store them in 1D-array of 1D-arrays which elements are addressed as B(i)(j)
Both arrays A and B seems to be similar, but working with them is a little bit different: addressing their elements as A(i)(j) or B(i, j) does not work.

If the array elements are numbers, then the arithmetic like A(i,j)*A(m,n) or B(i)(j)*B(m)(n) works. However in your case the array elements are strings and therefore the arithmetic operations cannot work.

### RE: Convert a String to 2D array and Operate their values

jtm2020hyo, if I misunderstood your question and you need something completely different, don't hesitate to ask

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!