Hi great time I'meters very brand-new to powerbuilder and I'michael using PB 11.5
Can someone understand how to import comma delimited text message document into datawindow.
How to Parse XML in PowerBuilder. We have been using the PBDOM object to parse XML returned by a REST Service and consume the values in our legacy PowerBuilder application for quite a while now.There have been several documentation on how to do this and many have expressed that they are quite happy with the result. Specifically, the properties describe the format of the data in the files and control how the data should be read from the datastore. When you create a TabularTextDatastore object, the datastore function uses the first file in the Files property to determine the values of the properties.
Example Text document
'1234','20141011','Juan, Delacruz','Usa','001992345456'.
'12345','20141011','Arc, Ino','Newyork','005765753256'.
How can I import the third line which is the full name and the final column which is the accounts quantity. I desire to exchange the title and accounts quantity into my exterior data windowpane. I've attempted to make use of the ImportString(all the rows are being moved in 1 column just). I have three fields in my external data home window.the Title and Accounts amount.
Right here's the program code
Please be sure to help me with the code! Thank You
Jeyse Bel
Jeyse BelJeyse Bel
2 Answers
It seems that PB desires by default a tab-separated csv document (while the 'd' from 'csv' stands for 'coma'.).
Include the
csv!
enumerated worth in the disputes ofImportString
and it should fix the stage (it will in my test box).Also,the columns described in your dataobject must suit the columns in the csv file(at minimum for the the initial columns your are curious in). If there are mode columns in the csv file, they will be ignored. But if you need to get the 1stestosterone levels (or 2nd) and 3rd columns, you require to establish the very first 3 columns. You can generally conceal the #1 or #2 if you perform not require it.
BTW, your code provides some problems :
- you should generally check the return beliefs of function telephone calls like
FileOpen
for ceasing processing in case of non-existent / non-readable file - You are reading the text file twice for the 1st row: once before the
while
and another inside of of the loop. Or probably it is certainly designed to ignore a 1st line with line headers ?
FWIF, right here will be a working code structured on yours:
SekiSeki
use
datawindowname.importfile(CSV!,filepath)
technique.Taryn♦
Santosh Kumar DuttaSantosh Kumar Dutta