top of page

When working with data from .csv files in Excel that includes numbers with multiple decimal places, take special care to make sure none of the decimal places are cut off.

If you have an Excel spreadsheet with differing decimal places in a column of numbers, and the column is not formatted to display all of the decimal numbers:

. . . when the file is saved to a .csv file, the undisplayed decimals will be dropped.

If you have an existing .csv file which has numbers with varying numbers of decimal places, which is opened, edited, and saved in Excel:

. . . some of the decimal places may be dropped when the file is opened in Excel again, and the numbers rounded up:

23 views0 comments

The Tip of the Night for December 24, 2022 noted that using a PowerShell script to copy multiple files from multiple locations to another location will work faster than XCOPY.

There is some debate online about whether or not the robocopy command will be faster than Windows Explorer copying the contents of one directory to another folder. I decided to test Explorer, robocopy, xcopy, and PowerShell against one another to see if there was any real difference when copying a single data set to a new location.

A took a sample of1824 files in 17 folders which came to 7.13 GB, and ran commands to transfer them from an external solid state drive to the C drive of a Dell XPS laptop with 16 GB of RAM. There was little difference in the elapsed time for each method, so the thing to do is to keep it simple and use Explorer. I guess the jury is out as to whether robocopy would work faster on a network. I will try to test this soon . . .

Windows Explorer 1 minute 9 seconds

robocopy 1 minute 14 seconds

PowerShell 1 minute 14 seconds

xcopy 1 minute 14 seconds

Note that when using robocopy it's necessary to share the source folder, and run the command in the admin mode of command prompt.

When setting the location for an external hard drive used as a source, copy the network path located under Properties. The device itself should have an alphanumeric code something like H4L34V8 - the code for my drive has been redacted in these screen grabs.

37 views0 comments

You can easily add text to the end of a text file using the PowerShell Add-Content command. So if you have text file like this which has only one line of text:

. . .and you want to add four new lines of text, you can write a PowerShell script like this:

Add-Content "C:\foofolder\test\test\NL East.txt" "`nPhiladelphia Phillies"

Add-Content "C:\foofolder\test\test\NL East.txt" "Atlanta Braves"

Add-Content "C:\foofolder\test\test\NL East.txt" "Washington Nationals"

Add-Content "C:\foofolder\test\test\NL East.txt" "Florida Marlins"

Open Windows PowerShell ISE [everyone running Windows should have this preinstalled], and enter the script in the script pane, and then run the script by clicking the green play button.

Note that for the first new line, we need to indicate that a line break should be entered. This is done by using a backtick '`' and an 'n' as a reference. The backtick is not the same as an apostrophe. On most keyboards it will be at the top far left before the number keys, and below the tilde key. Adding a `n reference for each new line will lead to the new entries being double spaced.

15 views0 comments
bottom of page