What Code Or Macro Can I Use To Substitute Text To Column

Corried

Board Regular
Joined
Dec 19, 2019
Messages
217
Office Version
  1. 2019
Platform
  1. Windows
  2. Web
Hello Everyone.

Presently I have Many Raw Data below to section out.

What's beautiful, all the following data are similar:
Here is an example in row "1", in column "A" only :
0: {c: 9, close: 9, yield: null, referenceDate: null, date: "1997-03-01T00:00:00", …}

In this Case: How can I Keep the values of The following:
91997-03-01
I have multiple data similar like above. The comparison with the others are, values and dates.

What is the effective way to get the data?
Or what code can I use? How do you want me to proceed?

Thanks in advance
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
your data looks that that which would come out of a database dump from a mysql db or sql server db. is that what it is?

You can use vba for sure, but you might have better luck if you have any familiarity with the function called REGEX(). ever used that? it's quite complex and you've got to be a pretty good programmer to create an input for it, but if you manage to do it, it can be quite powerful.
 
Upvote 0
your data looks that that which would come out of a database dump from a mysql db or sql server db. is that what it is?

You can use vba for sure, but you might have better luck if you have any familiarity with the function called REGEX(). ever used that? it's quite complex and you've got to be a pretty good programmer to create an input for it, but if you manage to do it, it can be quite powerful.

The data is from a web page in insect elements, I understand that programmer is the one who can obtain the data online.

How can you help me with the basic of coding in excell
 
Upvote 0
well before I, or anyone else attempts that, can you post like, say, 10 records from the data dump you've got? that would show whether or not there's a common pattern with the data you're looking at.

and by the way, you don't have to know anything about programming to get data from a webpage into excel. excel has a feature that is able to query, for instance, an HTML table element directly and pull the data out, using only interface menus. so excel is quite useful in this regard.
 
Upvote 0
well before I, or anyone else attempts that, can you post like, say, 10 records from the data dump you've got? that would show whether or not there's a common pattern with the data you're looking at.

and by the way, you don't have to know anything about programming to get data from a webpage into excel. excel has a feature that is able to query, for instance, an HTML table element directly and pull the data out, using only interface menus. so excel is quite useful in this regard.

Please view the sample file below.

Please note: the raw data is on cell "A1" and
The extracted data example is on cell "N" and cell "O"

There are many excel workbook I need to extract data.

How can I create a universal code to extract each one.

Thanks in advance.
 
Upvote 0
ok, I tried to do this in the cells, but excel does not have some of these vba functions built in, so do this:
Code:
Function extract_data_from_raw_dump()
Dim r As Range
Dim curRow As Long
Dim col1 As String
Dim col2 As String

On Error GoTo NextR

Application.ScreenUpdating = False
curRow = 1
    For Each r In Range("a1", Range("a1").End(xlDown))
        Range("m" & CStr(curRow)) = CLng(Mid(r, InStr(r, ",") - 2, 2))
        Range("n" & CStr(curRow)) = Mid(r, InStr(r, """") + 1, 10)
NextR:
    curRow = curRow + 1
    Next r
Application.ScreenUpdating = True
End Function
you will have to get rid of the cells that have section indicators in them, like this: [100 … 199] , otherwise it will throw an error. have fun. :)
 
Last edited:
Upvote 0
With formulae
=LEFT(REPLACE(A1,1,SEARCH("date:"&CHAR(160)&"""",A1)+6,""),10)*1
and
=LEFT(SUBSTITUTE(REPLACE(A1,1,SEARCH("{c:",A1)+3,""),",",REPT(" ",5)),4)*1
 
Upvote 0
see? my complex nature NEVER works best. :rolleyes:
 
Upvote 0
More formula alternatives.

For c:
=LOOKUP(999999,--MID(A1,FIND("c:",A1)+LEN("c:"),{1;2;3;4;6}))

For date (format as YYYY-MM-DD):
=LOOKUP(99999,--MID(A1,FIND("date: """,A1)+LEN("date: """),{1;2;3;4;6;7;8;9;10}))
 
Upvote 0

Forum statistics

Threads
1,214,863
Messages
6,121,978
Members
449,058
Latest member
oculus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top