Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAHello all,
I tried 3 different methods to extract the value pairs out of that file.
First: I ended up using 9 Regex replace tools, 2 text to columns, 1 data cleansing tool, and 1 select tool to wrangle the data into value pairs; however, this would not be scalable with other html files.
Second: I ended up using 8 Regex replace tools, 1 JSON parse tool, and 1 select tool to turn the html into JSON format and get value pairs. Again: this method would not be scalable with other html files.
Third: I added the below script code to the head portion of the html to be able to use the jQuery library and created a looping mechanism to iterate through all the tr elements and pushed the td elements' contents into an array to be able to view the results on the console tab of the browser developer window. This gives me the opportunity to copy and paste the results into Excel separated by a pipe. Now: this would be scalable for any html file.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
$('tr').each(function() {
var text;
var list = [] ;
text = text + $(this).html() + '|' ;
list.push(text);
console.log( list);})
This post has been edited by Community Moderation to redact sensitive attachments. The original attachment has been replaced by post_placeholder.txt.
This post has been edited by Community Moderation to redact sensitive attachments. The original attachment has been replaced by post_placeholder.txt.
The first iteration wasn't pretty but functional, so decided to redo and then tackle with RegEx and use the create columns after some solution inspiration.
This post has been edited by Community Moderation to redact sensitive attachments. The original attachment has been replaced by post_placeholder.txt.