'
' Create GCVS Name/Number cross reference. Yes this could be done 
' programmatically. Uses the latest Kholopov, et al. GCVS data
' file III.TXT.
'
Option Explicit

Dim TAB, FSO, Buf, GName1, GName2, GCVSStream, TabStream

TAB = Chr(9)
Set FSO = CreateObject("Scripting.FileSystemObject")
Set GCVSStream = FSO.OpenTextFile("E:\StarryNight Catalogs\Unfinished\GCVS\Latest Data\iii.dat.txt")
Set TabStream = FSO.CreateTextFile("E:\StarryNight Catalogs\AAVSO Names and Markers\gcvs-crossref-tab.txt")

Do While Not GCVSStream.AtEndOfStream
	Buf = GCVSStream.ReadLine()
	TabStream.Write Trim(Mid(Buf, 1, 6)) & TAB		' GCVS Catalog #
	GName1 = Trim(Mid(Buf, 9, 5))					' GCVS var code
	GName2 = Trim(Mid(Buf, 15, 3))					' GCVS Constellation code
	TabStream.Write GName1 & " " & GName2 & VbCrLf	' Shortened GCVS name
Loop
GCVSStream.Close
TabStream.Close

	
