Tag Archives: Uncategorized

Uncomplicated

Simple things are what I am all about, very straight forward and honest.  Just like this code, very simple and straight forward way to modify an existing file:

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
namespace AlexaListTrim
{
public static class Program
{
static void Main()
{
var txtString = new List<string>();
var modTxtString = new List<string>();
if (File.Exists(@"c:\temp\text.txt"))
{
using (var sr = new StreamReader(@"c:\temp\text.txt"))
{
while (sr.Peek() >= 0)
{
txtString.Add(sr.ReadLine());
}
}
foreach (var food in txtString)
{
Console.WriteLine($@"Trimming: {food}");
if (food.Length <= 0 || (food.IndexOf(".", StringComparison.Ordinal) + 2).ToString() == string.Empty ||
!food.Contains(".")) continue;
var newFood = food.Substring(food.IndexOf(".", StringComparison.Ordinal) + 2) + "\r\n";
modTxtString.Add(newFood);
}
using (var sw = new StreamWriter(@"c:\temp\out.txt"))
{
foreach (var food in modTxtString)
{
sw.Write(food);
}
}
Console.WriteLine(@"All done! Press any key to start Notepad.exe");
Console.ReadKey();
File.Delete(@"c:\temp\text.txt");
Process.Start("Notepad.exe", @"c:\temp\out.txt");
}
else
{
Console.WriteLine(@"Save text.txt to c:\temp before running!");
Console.WriteLine(@"Press any key to exit....");
Console.ReadKey();
}
}
}
}
view raw Program.cs hosted with ❤ by GitHub

My Simple Grocery List App

This is a family crowdsourcing app for shopping lists that helps Mom make fewer trips and get everything in one go. Each family member installs the app to their Android or iOS phone and manages their own lists. They each share their individual lists through the cloud with their Mom, who then has a big picture list of what everyone wants and what store. It is a Xamarin.Forms app that is cross-platform and backed by Microsoft’s Azure Cloud.  The app runs $3.50 per month per device; it is an invitation-only installation.

This is a demo of iOS, Android and Windows for you to see how it functions a bit: