Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to convert a single dimension array to two dimensional array
#2
Solved: 9 Years, 5 Months, 4 Weeks ago
You have not mentioned proper data information with your question. But what I got to know from your question I am sending possible solution:

First import that data from CSV to data table by this below formula:
DataTable.ImportSheet(FileName, SRCSheetName, DestinationSheetName)

After doing this, You will have all the csv data into your specified data table sheet.

Now if your data is in two columns, take the count of data from data table and based on the row count, create a for loop till the last count and insert the data in two dimension array like below:

Code:
Dim a()

rcount = DataTable.GetRowCount

ReDim a(rcount-1, 1)

For i = 0 To rcount
    For j = 0 To 1 Step 1
        a(i, j) = DataTable.Value(...PrameterID..)
    Next
Next

Use this code and let me know if still there is any problem.
Reply


Messages In This Thread
RE: How to convert a single dimension array to two dimensional array - by pranikgarg - 02-10-2014, 02:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  String Array Declaration Bhuvana 0 1,013 01-07-2020, 12:59 PM
Last Post: Bhuvana
  How To Capture Array Value into Excel Worksheet? Studymode 0 1,421 01-09-2018, 08:37 AM
Last Post: Studymode
  Choosing element from array marvson 1 1,908 06-29-2016, 02:55 PM
Last Post: Ankesh
  [UFT] Get Item of ListBox and convert it to array felino 1 2,444 11-26-2015, 02:20 PM
Last Post: felino
  Need a logic in array - QTP surestud 4 3,192 08-20-2015, 02:47 PM
Last Post: cuongtv

Forum Jump:


Users browsing this thread: 1 Guest(s)