When I access an api. it returns data in below format
n2035014,25 N2035014,25 B2035014,2944.40,250,3787.30,2400 o24,22971.20 h24,23064.15 l24,22641.40 c24,22945.05 i24,22744.40

I am clueless how to map these data and store in mysql table.
First set of data highlited in bold is dataset 1, followed by second set of data which has a prefix that needs to be mapped from below reference table. And above is just an example output, usually it will have 500 such dataset.

i=current value
B=bid
o= open
h=high
l=low
c=close

I want to store something like this

stock code | Current Value | Open | High | Low | Close | Bid
24 |22744.40 |22971.20 |23064.15 |22641.40 |22945.05
2035014 25 |Null | Null | Null | Null | 2944.40,250,3787.30,2400

Thanks for guidance.

Recommended Answers

All 3 Replies

When I access an api. it returns data in below format
n2035014,25 N2035014,25 B2035014,2944.40,250,3787.30,2400 o24,22971.20 h24,23064.15 l24,22641.40 c24,22945.05 i24,22744.40

I have my doubts as to the format of the returned data. Can you please be specific? For example, is the data returned as a blank-delimited string or as a series of strings? What do you mean by a dataset? You identify several prefixes (i, B, o, h, l, c) but not n or N. You mention field names like stock code and Current Value but not how they map onto the data returned by the api.

In order to retrieve the desired data the user present a set of criteria by a query. Then the Database Management System (DBMS), software for managing databases, selects the demanded data from the database. The retrieved data may be stored in a file, printed, or viewed on the screen.

MySQL will store data in the default directory and In order to retrieve the desired data the user present a set of criteria by a query.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.