How to combine 2 prior search histories and import to new machine

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
stevenroussos
Posts: 43
Joined: Wed Apr 08, 2015 10:00 pm

How to combine 2 prior search histories and import to new machine

Post by stevenroussos »

Had prior main computer sent for warranty repair, contents backed up. Used another in the interim. Both with Everything. Main computer replaced with brand shiny new one (YAY!)

Can someone help with the proper Command Window or PowerShell commands to correctly combine the 2 older history .csv files into one, and place them via correct procedure so result is properly used by new machine's Everything installation.

ALSO: what files to copy to replicate all options and settings (probably not required, but might come in handy.)

THANKS!!
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: How to combine 2 prior search histories and import to new machine

Post by NotNull »

You can open the "Search History.csv" files in Notepad and copy the text - minus the "Search","Search Count","Last Search Date" first line from one to another and save the resulting combined search history file.

But to answer your question:

CMD solution

This will work only on Windows 10 systems
  • Put SearchMerge.cmd somewhere on your system
  • double-click it in File Explorer.
    Follow the on-screen instructions:
  • Drag the first csv file to the script window and press ENTER
  • Repeat for all other csv files (might be more than 2 ..)
  • After the last file was added, press ENTER
  • Copy resulting "Merged Search History.csv" to your Everything folder as "Search History.csv"
  • Done!

Code: Select all

@echo off
setlocal
pushd "%~dp0"
::_________________________________________________________
::
::			INIT
::_________________________________________________________
::

set FILE=

::_________________________________________________________
::
::			ACTION!
::_________________________________________________________
::

::	FIRST FILE
	echo.
	echo.	Drag first Search History file here and press ENTER
	echo.
	set /P FILE= FILENAME : >nul

	If [%FILE%] equ [] goto :EOF
	set "MERGE=%FILE%"
	set "FILE="


::	NEXT FILE(S)
:LOOP
	echo.
	echo.	Drag next Search History file here and press ENTER
	echo.	If there are no files left, just press ENTER
	echo.

	set /P FILE= FILENAME : 

	If [%FILE%] equ [] (  ::No more files
		rem 
	) ELSE ( :: another file
		set "MERGE=%MERGE% + %FILE%"
		set "FILE="
		goto :LOOP
	)

	rem echo. [%MERGE%]
	copy /b %MERGE% "FF.deleteme" >nul
	sort /R /UNIQUE "FF.deleteme" /OUTPUT "Merged Search History.csv"


::_________________________________________________________
::
::			WRAP IT UP
::_________________________________________________________
::

	del /Q "FF.deleteme"

	echo._________________________________________________________________
	echo.
	echo.	The merged history is in "%~dp0Merged Search History.csv"
	echo.	Save it as "Search History.csv" in your Everything folder.
	echo._________________________________________________________________
	echo.
pause

Powershell solution
  • Put SearchMerge.ps1 somewhere on your system
  • Start PowerShell
  • CD to the folder wher you put the script
  • Type .\SearchMerge.ps1 "C:\path to\first.csv" "D:\path\second.csv" "E:\third.csv"
    (replace with actual filenames)
  • Press ENTER
  • Result is in "Merged Search History.csv"
  • Copy resulting "Merged Search History.csv" to your Everything folder as "Search History.csv"
  • Done!

Code: Select all

gi $args | % {import-csv $_} | Export-csv "$PSScriptRoot\Merged Search History.csv" -NoTypeInformation
Post Reply