Csharp

Creating A JSON File From My Record List - RecordDBToJSON

Using SQL Server for generating JSON wasn’t totally successful so I created a program to reformat my record list into JSON for use in my JavaScript projects. I wanted to load it into my local storage and use it as a data source. See my previous article. The program I created runs in the console and has no arguments. It just grabs a dump of my Artist and Record tables and merges the two sources as a 1 artist to many records JSON file.

Using Powershell to Create JSON From SQL Server

While searching for ways to generate JSON from SQL Server I found a video on using Powershell to generate JSON using calls to SQL Server. This looked interesting so I tried it out and it worked. Unfortunately it still didn’t validate and just generated rubbish. I loaded the data into a text editor and found that when it hit the line return point it chopped data and added three dots to the end of each line.

Using SQL Server to Create JSON

I am currently creating a JavaScript based website to display a version of my RecordDB database. The data will need to be consumed from a JSON file that will be stored in a web browser using local storage. The advantage of using local storage is that it is persistent and will still be available once you close and reopen your web browser. The first part of this process will be to export my data from a SQL Server database to a JSON formatted file.

Changing Link Program to Web Request

Changing the Link program to download a Web Request My Link, Packt and Plural programs have been set up to manually get a webpage and this is a slow process. I have updated the Link program to pass in a URL as an argument and then download and create the page automatically. This saves me a boring task. The program update was more complex than I originally thought because the pages I was trying to download used a network security protocol so I was getting TLS security failure exceptions.

Renumbering Training and Music Files - Num

Following on from my directory renaming program I have written some more code to renumber my video training and music files. Once again this is something that I have been doing for years and should have automated as some of the training materials can take around 10 to 45 minutes of manual work. I have a backlog of files that I wasn’t going to finish so I had to come up with a better way of doing the task.

Renaming Directories - Dlist

I often have to rename directories in the training materials that I download. They never seem to have a consistent file structure so I manually create a batch file to rename the directories. This takes me around 2-3 minutes each time I do it and I find that I am constantly creating batch files to do this task. Today I spent around 2 hours to automate this process and have run the program on a number of directories to test that it works correctly.

Renamer Project

I downloaded some files recently and every file contained a prefix with the website’s name in it. This included all of the source code files which rendered the code useless. I tried using my Name utility program to remove the offending phrase but it ended up changing the names of some files. I need to remove the prefix without changing the rest of the filename. My first option was to search the web for a free file renaming program.