saludos
Moderador: Moderadores
You need PESFAN Editor 6. Open your option file with it. In the menu bar, select Tools -> Make csv stats file...
Select all three options in the right part (Column Headings, Extra Players, Created Players). Then save the csv file in any folder.
Now open a new file in Excel. Select A1, and go to Tools -> Macros -> Visual Basic Editor (I don't know exactly what names the menus have, because i have the spanish Office). Now see the top-left part of the Editor, below the icons, ubicate where it says Page1, Page2..., double click in Page1, it will open the code editor. Copy and paste there this code:
Public Sub ImportTextFile(FName As String, Sep As String)
Dim RowNdx As Integer
Dim ColNdx As Integer
Dim TempVal As Variant
Dim WholeLine As String
Dim Pos As Integer
Dim NextPos As Integer
Dim SaveColNdx As Integer
Application.ScreenUpdating = False
'On Error GoTo EndMacro:
SaveColNdx = ActiveCell.Column
RowNdx = ActiveCell.Row
Open FName For Input Access Read As #1
While Not EOF(1)
Line Input #1, WholeLine
If Right(WholeLine, 1) <> Sep Then
WholeLine = WholeLine & Sep
End If
ColNdx = SaveColNdx
Pos = 1
NextPos = InStr(Pos, WholeLine, Sep)
While NextPos >= 1
TempVal = Mid(WholeLine, Pos, NextPos - Pos)
Cells(RowNdx, ColNdx).Value = TempVal
Pos = NextPos + 1
ColNdx = ColNdx + 1
NextPos = InStr(Pos, WholeLine, Sep)
Wend
RowNdx = RowNdx + 1
Wend
EndMacro:
On Error GoTo 0
Application.ScreenUpdating = True
Close #1
End Sub
Public Sub DoTheImport()
Dim FName As Variant
Dim Sep As String
FName = Application.GetOpenFilename _
(filefilter:="Text Files(*.txt),*.txt,All Files (*.*),*.*")
If FName = False Then
MsgBox "You didn't select a file"
Exit Sub
End If
Sep = InputBox("Enter a single delimiter character.", _
"Import Text File")
ImportTextFile CStr(FName), Sep
End Sub
Now click the "play" button in the standard toolbar. It will show the Open dialog. First where it says to open "text files", select "all files", then search for the first created csv file you saved before. Then it should open a message asking about the "separator". There write "," (without the "") and Accept. Wait some time, and then you should have a table with all option file data, divided by columns. I copied it to another excel file, to have it without macros. Then I inserted a column as the first column, with title "IDs". In this column, simply write 1 in A2, 2 in A3, and fill in all the column A incrementing the numbers, until you get to 5183.
The important thing is that PESFAN Editor makes the csv file ordering it with the player ID, so you can fill those numbers correctly.
I copied to another excel file only these columns: IDs, Name, Club Team.
Now you can for example order all the file by Name, or by Club Team, or even use filters. I applied a Filter in the first row (Data -> Filter -> "autofilter" or "self-filter", don't know the english name). So I can select any team "FC Barcelona" for example, as the Club Team, and it will show all Barça players with their IDs.
This process was long to write, but should take you less than 10 minutes. So you can do it everytime you change a lot of data in the option file, to update it.
Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 7 invitados