03-10-2011, 09:05 PM
I have a string of data that I need to split into individual components. I'm trying to use Split but it doesn't seem to be working.
Here is a sample string of data from my datatable "TranLine". contained here in '
' 0817102 30 A 1,464.49 1.15778-'
Here is my code I'm trying to do this with.
Another note: sometimes the string is all spaces with no data, sometimes the last peice of data is missing.
Here is a sample string of data from my datatable "TranLine". contained here in '
' 0817102 30 A 1,464.49 1.15778-'
Here is my code I'm trying to do this with.
Code:
myTranLine = DataTable("TranLine", dtGlobalSheet)
mySplit = Split(myTranLine, " ")
myNewTranLine = mySplit(0) & mySplit(1) & mySplit(2) & mySplit(3) & mySplit(4)
mySplit(0) = TranDate
mySplit(1) = TranCode1
mySplit(2) = TranCode2
mySplit(3) = TranAmnt
mySplit(4) = IntAdj
DataTable("TRANTYPE", dtGlobalSheet) = TranCode1 + TranCode2
DataTable("DATE", dtGlobalSheet) = TranDate
DataTable("TRAN1", dtGlobalSheet) = TranCode1
DataTable("TRAN2", dtGlobalSheet) = TranCode2
DataTable("AMT", dtGlobalSheet) = TranAmnt
Another note: sometimes the string is all spaces with no data, sometimes the last peice of data is missing.