|
||||
|
![]() |
#1 |
Hall Of Famer
Join Date: Feb 2012
Location: Inside The Game
Posts: 30,937
|
Is There an Easier Way to Mass Import NLB Players?
I have the file below that was given to be by Mitchkenn, I think, but in order to upload them i have to weirdly copy aspects of them and then paster it into a new txt file. i want to know if there is an easier way.
I am working on an All NLB file. 44 teams, every player all at once. Editing this file is tedious and could take me all 2024.
__________________
Go today don't wait for tomorrow It isn't promised, all the time you get borrowed Don't live your life for other people Don't bottle your emotions till they crack and fill a couple just sorrows Take your mind and refocus go get a paper write your goals out Throw your middle fingers to all your haters "Stay Strong" ![]() |
![]() |
![]() |
![]() |
#2 |
All Star Starter
Join Date: Nov 2009
Location: Fort Worth, TX
Posts: 1,088
|
What columns do you want in the text file? BBrefMinorsID and debutYear? I wrote a quick python script that converted the entire CSV to a txt file (see attached). Obviously it needs to be comma delineated with the correct columns, but I could probably put something together in a few mins.
EDIT: Made another text file with just ID and debut year (forOOTP.txt). Last edited by Cod; 01-01-2024 at 05:49 PM. |
![]() |
![]() |
![]() |
#3 | |
Hall Of Famer
Join Date: Feb 2012
Location: Inside The Game
Posts: 30,937
|
Quote:
Thank You.
__________________
Go today don't wait for tomorrow It isn't promised, all the time you get borrowed Don't live your life for other people Don't bottle your emotions till they crack and fill a couple just sorrows Take your mind and refocus go get a paper write your goals out Throw your middle fingers to all your haters "Stay Strong" ![]() |
|
![]() |
![]() |
![]() |
#4 |
All Star Starter
Join Date: Nov 2009
Location: Fort Worth, TX
Posts: 1,088
|
Glad it worked. Seeing Norman "Turkey" Stearnes as one star hurts my heart
![]() |
![]() |
![]() |
![]() |
#5 |
Hall Of Famer
Join Date: Feb 2012
Location: Inside The Game
Posts: 30,937
|
He's great in my EBL vs MLB save.So not sure what i did differently when i imported him.
__________________
Go today don't wait for tomorrow It isn't promised, all the time you get borrowed Don't live your life for other people Don't bottle your emotions till they crack and fill a couple just sorrows Take your mind and refocus go get a paper write your goals out Throw your middle fingers to all your haters "Stay Strong" ![]() Last edited by The Game; 01-04-2024 at 02:18 PM. |
![]() |
![]() |
![]() |
#6 |
All Star Reserve
Join Date: Oct 2021
Location: West
Posts: 724
|
Could one of you please tell me how I can mass import historical MLB players?
|
![]() |
![]() |
![]() |
#7 |
Global Moderator
Join Date: Feb 2004
Location: From Duxbury, Mass residing Baltimore
Posts: 7,172
|
How mass are we talking? Is there any common theme? All of a particular debut year? The all-time WAR leaderboard of the Diamondbacks? How broken up can it be?
__________________
Complete Universe Facegen Pack 2.0 (mine included) https://www.mediafire.com/file_premi...k_2.0.zip/file Just my Facegen Pack: https://www.mediafire.com/file_premi..._Pack.zip/file |
![]() |
![]() |
![]() |
#8 |
All Star Reserve
Join Date: Oct 2021
Location: West
Posts: 724
|
Lans,
I'm thinking along the lines of something like, say, every player from the D-Backs, 1999-2003, from each individual season. So in this example, there'd be 5 Gonzos in there, but one Reggie Sanders from the one season he was with the club. |
![]() |
![]() |
![]() |
#9 | |
Global Moderator
Join Date: Feb 2004
Location: From Duxbury, Mass residing Baltimore
Posts: 7,172
|
Quote:
Start here: https://www.baseball-reference.com/t...9-roster.shtml Select that table with all the names like you are doing in an ordinary highlight selection. Then copy it. Then paste it into Excel. You will have a nice bunch of columns reflecting that very table. Name, Age, Country, Bats, Throws... etc. Color the bottom row (the one with the last guy on the roster list so you know he is the last guy in 1999). Repeat this for every year. Then delete all the columns except the name (which pasted as a hyperlink). You should have just a list of the names with that colored fill line marking every year break. Not in the column to the right of that name list, but the next column (So if names are in column A go to column C) and then put 1999 in column C for every row that is populated until you get to that first colored line (who also gets 1999.) Then after that line you know the 2000 guys start so add 2000 in their column C. (also delete any of the headers from these additional year pastings). Repeat for all the years you posted. Then save that Excel sheet as a Macro-enabled Excel sheet (these end in .xlsm). Then go to the Developer tab and select "Virtual Basic". That opens a box with its own header. From that new header, select "Insert" and then select "Module" and a big blank white space you can type in appears. Paste this into that page: Sub ExtractHL() Dim HL As Hyperlink For Each HL In ActiveSheet.Hyperlinks HL.Range.Offset(0, 1).Value = HL.Address Next End Sub Then go back to the box header and select "Run" and from that list choose the option "Run/SubUserForm". Close out of that Developer area now. You can now see why we left column B blank. The hyperlinks of the names from column A are extracted into Column B. Select column B in its entirety and pull up Find and Replace. Find "https://www.baseball-reference.com/players/*/" - notice my wildcard asterisk. That's important. Leave the "Replace" line blank since we want to delete that part of the web address. Now repeat the find and replace with ".shtml". See that we have removed the other part of the link we didn't need. Column B is just the import code now for all those players - and you have their year in Column C. That code still is a hyperlink though, so go and highlight all of column B again and right click. Select "Remove hyperlink". Delete Column A. Delete blank columns on the left so that the IDs are in Column A and the years in Column B. Save that macro-enabled Excel file as a .csv file. Convert that .csv file to a text file and you should have the code, a comma and then the year. That's the mass import text file. I do this all the time (except the .csv to .txt. conversion) but that should work as described. It seems like a lot when I type it out but it's just a lot of clicks that you get used to. You know how to find me if you need a hand in any of the steps. Good luck!
__________________
Complete Universe Facegen Pack 2.0 (mine included) https://www.mediafire.com/file_premi...k_2.0.zip/file Just my Facegen Pack: https://www.mediafire.com/file_premi..._Pack.zip/file Last edited by LansdowneSt; 01-05-2024 at 12:03 AM. Reason: typo |
|
![]() |
![]() |
![]() |
#10 |
All Star Reserve
Join Date: Oct 2021
Location: West
Posts: 724
|
Thank you for taking the time to explain how! Just read this, will try it out now.
|
![]() |
![]() |
![]() |
#11 | |
Hall Of Famer
Join Date: Nov 2019
Posts: 13,021
|
Quote:
That file is the one you add in the IMPORT HISTORICAL PLAYERS dialogue box, with minors DB selected and all the other settings EG make bads you want. Works a treat for me, without fail. not sure you can do the same on Windows, though. Now regarding that old file we've both been using for ages. The issue is that for 24, a project began to bring those old 049 IDs into line with BBRef. so many of them no longer work. So I normally keep the players names in the original .xlsx file I create (then delete them in the .csv copy) for ready reference after you do the import so you can see which one(s) didn't go through. I am SLOWLY fixing that file as I do new imports into my Everyman League save, but that is only one season every fortnight or so. Like your project, that means it is some way off completion. Hope that helps. G
__________________
HISTORICAL DO-OVERS A'S RED SOX DODGERS CUSTOM SAVES ECLIPSE LEAGUE MOON SHOT LEAGUE EVERYMAN LEAGUE GULF LEAGUE USBA |
|
![]() |
![]() |
![]() |
#12 | |
Hall Of Famer
Join Date: Feb 2012
Location: Inside The Game
Posts: 30,937
|
Quote:
I created a Custom League with real teams with all the White Sox 1901 - 2022. i dumped all players into FA pool. Sorted them by name. I then went in and deleted all players keeping only the players with their 1st year in a Sox jersey. Then I imported all players using their BBREF ID for players that were traded to the Sox but were not on the team the next season. It took me 2 days. I then created my 50 team ASPBL Ran a FA draft. I do have several errors though. For some reason i have both the 1902 Cubs & 902 White Sox. i am missing 22 players that were traded to the Sox prior to FA that also later played for the Sox, Meaning i have their 1st full season not their partial season. see more below https://forums.ootpdevelopments.com/...76#post5052976 You could also just pull up each players BBREF ID and right click copy them all into a notepad file.5 years should only take an hour or 2.i don't have excel or a free version of it.
__________________
Go today don't wait for tomorrow It isn't promised, all the time you get borrowed Don't live your life for other people Don't bottle your emotions till they crack and fill a couple just sorrows Take your mind and refocus go get a paper write your goals out Throw your middle fingers to all your haters "Stay Strong" ![]() Last edited by The Game; 01-05-2024 at 11:40 AM. |
|
![]() |
![]() |
![]() |
Bookmarks |
|
|