Data cleaning/import

rugge78

New Member
Joined
Jul 7, 2021
Messages
3
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Platform
  1. Windows
Hi,

I am trying to clean and import the data from the attached text file but couldn't conclude as i am unable to split the rows and columns and sort/align the data into appropriate columns. Could you please assist/advise.

I am trying to use power query to import and transform the data.

Thanks.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
oops...sorry couldn't upload the source data file in the earlier thread....here is some of the content from it.

{"intersectionId":1,"intersectionDescription":"Dorchester Road and Huron Church Road","traffic":[{"timeStamp":"2020-03-31T12:00:00","vehicleType":"Light","entrance":"E","exit":"N","qty":2,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:00:00","vehicleType":"Light","entrance":"E","exit":"S","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:00:00","vehicleType":"ArticulatedTruck","entrance":"N","exit":"S","qty":3,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:00:00","vehicleType":"Light","entrance":"N","exit":"S","qty":6,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:00:00","vehicleType":"Light","entrance":"S","exit":"E","qty":2,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:00:00","vehicleType":"ArticulatedTruck","entrance":"S","exit":"N","qty":2,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:00:00","vehicleType":"Bus","entrance":"S","exit":"N","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:00:00","vehicleType":"Light","entrance":"S","exit":"N","qty":3,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:00:00","vehicleType":"SingleUnitTruck","entrance":"S","exit":"N","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:00:00","vehicleType":"ArticulatedTruck","entrance":"W","exit":"S","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:01:00","vehicleType":"Light","entrance":"E","exit":"S","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:01:00","vehicleType":"ArticulatedTruck","entrance":"N","exit":"S","qty":2,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:01:00","vehicleType":"Light","entrance":"N","exit":"S","qty":4,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:01:00","vehicleType":"Light","entrance":"S","exit":"E","qty":2,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:01:00","vehicleType":"ArticulatedTruck","entrance":"S","exit":"N","qty":3,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:01:00","vehicleType":"Bus","entrance":"S","exit":"N","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:01:00","vehicleType":"Light","entrance":"S","exit":"N","qty":2,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:01:00","vehicleType":"ArticulatedTruck","entrance":"W","exit":"S","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:02:00","vehicleType":"Light","entrance":"E","exit":"N","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:02:00","vehicleType":"SingleUnitTruck","entrance":"E","exit":"N","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:02:00","vehicleType":"Light","entrance":"E","exit":"S","qty":2,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:02:00","vehicleType":"Light","entrance":"E","exit":"W","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:02:00","vehicleType":"Light","entrance":"N","exit":"E","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:02:00","vehicleType":"Light","entrance":"S","exit":"E","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:02:00","vehicleType":"ArticulatedTruck","entrance":"S","exit":"N","qty":2,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:02:00","vehicleType":"Light","entrance":"S","exit":"N","qty":4,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:03:00","vehicleType":"Light","entrance":"E","exit":"W","qty":3,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:03:00","vehicleType":"Light","entrance":"N","exit":"E","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:03:00","vehicleType":"Light","entrance":"N","exit":"S","qty":3,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:03:00","vehicleType":"SingleUnitTruck","entrance":"N","exit":"S","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:03:00","vehicleType":"ArticulatedTruck","entrance":"S","exit":"N","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:03:00","vehicleType":"Light","entrance":"S","exit":"N","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:03:00","vehicleType":"WorkVan","entrance":"S","exit":"N","qty":1,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-31T12:03:00","vehicleType":"Light","entrance":"W","exit":"E","qty":2,"isDaylightSavingsTime":true},{"timeStamp":"2020-03-
.
.
.
.
.
..
.
.
.
..
.
 
Upvote 0
Just an FYI on cross posting for this post : I have also posted this query on another forum seeking for answers.

Below mentioned is the URL.


Thanks.
 
Upvote 0
oops...sorry couldn't upload the source data file in the earlier thread....here is some of the content from it.
So, this is only part of the file, isn't it?. I think Your file is a JSON file.
If I'm right, we can use this code below.
Power Query:
let
  Source        = Json.Document(File.Contents("PathToYourTXTFile")),
  ToTable       = Table.FromRecords({Source}),
  Headers       = Record.FieldNames(ToTable{0}[traffic]{0}),
  traffic       = Table.TransformColumns(ToTable, {{"traffic", each Table.FromRecords(_)}}),
  ExpandTraffic = Table.ExpandTableColumn(traffic, "traffic", Headers)
in
  ExpandTraffic
 
Upvote 0

Forum statistics

Threads
1,223,705
Messages
6,173,989
Members
452,541
Latest member
haasro02

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