View Single Post
Old 06-06-2006, 10:01 AM   #19
redmarkYankees
All Star Starter
 
redmarkYankees's Avatar
 
Join Date: Nov 2003
Posts: 1,283
nm, got it.

Batting.csv and Fielding.csv lack carriage return characters, having only linefeeds. Some users systems presumably have setups or other software installed that allows them to cope with that; others don't.

For anyone who wants to try fixing that to get a speedy Lahman import and isn't afraid to run vbscript given by some bloke on the internet - copy and paste the following into Notepad:



set oFS = createobject("scripting.filesystemobject")
set oFILE1 = oFS.GetFile("Batting.csv")
oFILE1.Name = "Batting.bak"
set oFILE2 = oFS.GetFile("Fielding.csv")
oFILE2.Name = "Fielding.bak"
set oTR1 = oFS.OpenTextFile("Batting.bak")
set oTW1 = oFS.CreateTextFile("Batting.csv")
set oTR2 = oFS.OpenTextFile("Fielding.bak")
set oTW2 = oFS.CreateTextFile("Fielding.csv")
Do
strTemp=oTR1.ReadLine
oTW1.WriteLine(strTemp)
Loop Until oTR1.AtEndOfStream
Do
strTemp=oTR2.ReadLine
oTW2.WriteLine(strTemp)
Loop Until oTR2.AtEndOfStream
set oFILE1 = Nothing
set oFILE2 = Nothing
set oTR1 = Nothing
set oTR2 = Nothing
set oTW1 = Nothing
set oTW2 = Nothing
set oFS = Nothing
Msgbox "Finished"



Save this as "whatever.vbs", in the same folder as your Lahman database. Double click the file.

That creates versions of the Batting.csv and Fielding.csv with proper end-of-line CR/LF combos; if that is the reason for slow loading/failure to load, this should fix it. (Temporary fix, obviously, for those who want to try). (All it does is read the line and writes it back to a new file, but doing it with vbscript means it gets a vbCrLf end of line combo).
__________________
In times of universal deceit, telling the truth will be a revolutionary act.
George Orwell

Last edited by redmarkYankees; 06-06-2006 at 10:06 AM.
redmarkYankees is offline   Reply With Quote