Friday, May 29, 2020

The Move

As mentioned, I am moving/I moved. Essentially across the country. For the past couple of months I've been unemployed as I left my last job due to restructuring conflicts.

The job search was a bit rough as there wasn't much in my field of work with my experience during the 2019 holidays then Covid-19 hit. As a result I was unemployed for a bit longer than anticipated. Then I suddenly received two job offers fairly close to one another. Both were on the west coast of the US while I was living on the east coast. I ended up taking the second offer as the first had some uncertainty to the duration of the project and they couldn't give me a start date due to Covid.

The second job offer wanted me to start work ASAP, so I couldn't really secure a web host for my blog. As a result I fell back to this Blogger account to keep followers updated.

The past 3 weeks have been absolute chaos. It started with me trying to get the various movers (house items, cars, etc) to commit to dates so I could make reservations. 

Side note: My spouse and I ended up driving an RV as we have pets and have done the hotel hop before with them. I can say for anyone who has to move long distances with pets, an RV is the way to go.

After we got the movers to commit we made the various reservations and got everything ready to move. We loaded up the RV with our pets and set up at a local campground while our house items were packed and loaded. After that we started the drive from South Carolina to Nevada.

For those who don't know the drive time is about 36 hours on the shortest route (not including bathroom breaks and food stops). We left on a Sunday and the first leg took about 8.5 hours from South Carolina to Tennessee. The next leg was from Tennessee to Missouri at about 8 hours. The next leg was from Missouri to Nebraska at 7.5 hours. Then from Nebraska to Wyoming at 7.75 hours. Then from Wyoming to Nevada at 6 hours.

After getting to Nevada, we had to check into temporary housing, clean out the RV, and return it (we rented it). This wasn't all done on the same day of course as the nearest return for the RV was about 3 hours away (6 hours round trip).

Currently, my company is paying for our temporary housing including utilities and internet. However, they are only providing basic internet and have their own router/modem. I don't want to incorporate my own network equipment and get into trouble (I'm not even supposed to change the wifi password). As a result, I'm not sure when I'll get my WordPress server back up and running. Hopefully it'll be soon.

Tuesday, May 12, 2020

Main Site Down

I am currently in the middle of moving. Until I get my server set back up, my content will reside on this Blogger page. Tune back in at a later date for updates.

Sunday, October 13, 2019

Converting XML to CSV


Better coding through PowerShell
$DataIn=New-Object System.Xml.XmlDocument
#Set starting point
$InFilePath=“F:\Query_Results\Complete\XML\X_to_Z”
#Set CSV Output Location
$OutFIlePath=“F:\Query_Results\Complete\1CSVs”
#Look through starting point for sub directories
Get-ChildItem -Directory -Path “$InFilePath” | ForEach-Object {
   #set subdirectory Path
   $SubDirectory=$_.FullName
   #Set Output CSV file
   $FileName=$_
   $OutFile=“$OutFilePath"+”$FileName"+“.csv”
   #monitor Progress
   Write-Host $OutFile
   #Get Contents of Sub Directory
   Get-ChildItem $SubDirectory | ForEach-Object {
      #Get Files to read
      $InFile = $_.FullName
      #DEBUG
      #Write-Host $InFile
      #Load Data
      $DataIn.Load(“$InFile”)
      #Check for data
      If($DataIn.Response.Count -ne 0){
        #parse content
        $Header=$DataIn.Response.SearchCriteria
        $IndexofMake=$Header.LastIndexOf(’ | ’)
        $ModelYear=($Header.Substring($IndexofMake+13,4) -replace “,”, “,”)
        $Body = $DataIn.Response.Results.MakeModels
        $Body | ForEach-Object{
          #set data to output
          $Make=($_.Make_Name -replace “,”, “,”)
          $MakeID=($_.Make_ID -replace “,”, “,”)
          $ModelID=($_.Model_ID -replace “,”, “,”)
          $ModelName=($_.Model_Name -replace “,”, “,”)
          $OutData = $ModelYear+ “,” + $Make + “,” + $MakeID + “,” + $ModelName + “,” + $ModelID
          #DEBUG
          #Write-Host “$OutData”
          #save data to file

          Add-Content -Path “$OutFile” -Value “$OutData” -Encoding UTF8
        }
     }
  }
}