Showing posts with label JSON. Show all posts
If you would like to load JSON and present it as a table, it's quite easy if you have an Excel 2016 [1]. It's more complicated, once you have a lower version.
First of all, try to install an additional plugin called Power Query [2].
In the Power Query ribbon tab, click From Other Sources > Blank Query, then go to Advanced Editor and input below query string. Do not forget to change the path to your JSON.
Click -> Close & Load let Source = Json.Document(File.Contents("Z:\Directory\input.json")), AsTable = Table.FromRecords(Source) in AsTable
Click on 'Close & Load'
Reference :
[1] Microsoft Support - Connect to a JSON file
[2] Power Query for Excel
Below you can find GitHub Gist of User Agents in JSON based on massive list of user agents provided by Chris Pederik [1]. I provided the same list of user agents in more friendly form as a JSON because of this one provided in reference is nested multiple times, what obviously affects the use of content. Moreover I removed duplicates.
Reference : [1] https://gist.github.com/enginnr/ed572cf5c324ad04ff2e
My recent project was aimed to develop standalone application written in Swing with embedded database which was in form of JSON file. During building my Jar using Maven, I was faced with problem to replace this JSON file before final application will be produced. Before you will prepare such solution you should get familiar with Maven Build Lifecycle [1]. Below I listed those LifeCycle's :
- validate
- generate-sources
- process-sources
- generate-resources
- process-resources
- compile
- process-classes
- generate-test-sources
- process-test-sources
- generate-test-resources
- process-test-resources
- test-compile
- test
- prepare-package (maven 2.1+)
- package
- pre-integration-test
- integration-test
- post-integration-test
- verify
- install
- deploy
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>fetchJSON</id>
<phase>prepare-package</phase>
<inherited>false</inherited>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>pl.avantis.iom.rest.DrupalQueriesImpl</mainClass>
<cleanupDaemonThreads>true</cleanupDaemonThreads>
<daemonThreadJoinTimeout>30000</daemonThreadJoinTimeout>
</configuration>
</plugin>
Reference : [1] Maven Build Lifecycle [2] Codehaus - Exec Maven Plugin