Ask-Answer | - 造轮子 之 问答社区
kandi X-RAY | Ask-Answer Summary
kandi X-RAY | Ask-Answer Summary
造轮子 之 问答社区(精简版知乎) .
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Ask-Answer
Ask-Answer Key Features
Ask-Answer Examples and Code Snippets
Community Discussions
Trending Discussions on Ask-Answer
QUESTION
I am using Amazon Mechanical Turk to transcribe receipt data. Amazon returns a CSV that is quite unreadable at first sight. URL to CSV file: https://drive.google.com/file/d/1QR4cgdVrkYwRni3YM5Dc_umIKFGiX_0k/view?usp=sharing
But when you import it into excel a set the Delimiter to Comma it is at least readable. Here is a URL to the excel file(Please download it and open with excel this makes it a lot better): https://drive.google.com/file/d/1Noj4UUMd-p1iYKIWDgKURQUzCdhu5Ck1/view?usp=sharing
But then Excel puts all the answers of the transcriber in one cell called "Answer.taskAnswers".
Desired outcome: The values of the transciber in an table like this (check this URL: https://i.ibb.co/vjf0t0c/Prefered-formatting-of-cell-Answer-task-Answers-2.png)
Possible solution 1: A way to format the CSV file to make it look something like the table from "desired outcome".
Possible solution 2: A formula that generates another table (possibly on another sheet) of "Answer.taskAnswers" that looks like the table from "desired outcome".
Does anyone know a fix for this?
...ANSWER
Answered 2019-Sep-04 at 16:16EDIT: M-code changed to allow for varying numbers of columns (products) in the csv JSON string
From the appearance of your output, I am guessing that you used Power Query
(aka Get & Transform
) to input the data.
If that is the case, you can edit the Query to obtain the output you are looking for. (If not, you can just use it anyway for the whole process).
The column from which you want the output parsed is in JSON format, and PQ has a built-in parser.
I worked from your original CSV file you provided.
We delete the irrelevant columns and blank rows, parse the JSON string, and then rearrange the data.
All of the steps except the custom column formula, can be done from the GUI.
The custom column formula extracts the elements from the JSON string in the relevant column: =Json.Document([Answer.taskAnswers])
You can just paste the M-code into the Advanced Editor in PQ, and then examine the steps in the GUI to see what's going on.
You will also have to edit the Source
line to reflect where you are actually getting the source data (and that can be a URL instead of a file)
M-Code
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Ask-Answer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page