Search results

  1. D

    Simple text import

    Bit confused now because of iFileNum. Should that be fileNum in the above code? Also, I use var = Split(strPGNdata, vbCrLf) to split my data into an array. When importing using the above method, does it pull in the vbCrLf characters too or does it use just a Lf or just a Cr?
  2. D

    Simple text import

    I get a syntax error and compile error on this line: Do Until EOF(#fileNum)
  3. D

    Simple text import

    Looks like our posts crossed there DCrake. Sample data in text file: I have a parsing routine already that manipulates the data. I just need to get it into a string!
  4. D

    Simple text import

    Not sure how to get the whole file!
  5. D

    Simple text import

    I did. I got the first line only!
  6. D

    Simple text import

    This may sound like a daft question but does that pick up just the first line in the text file?
  7. D

    Simple text import

    Do I call it like this? strdata = GetMyFile("C:\Folders\Data\testdata\B21.txt")
  8. D

    Simple text import

    I have a txt file that I want to import into a string. What is the simplest way of doing this? Thanks, Dave
  9. D

    Getting data into a table using vba

    I have some code that loops to parse some data. To get the data into a table, do I use Recordsets? Is it easier to parse the data into a string, use split and then cycle that array to push the data into a table? Or perhaps do it on the fly when looping through my parsing code? Dim i As...
  10. D

    Parsing PGN files

    Used Exit Do command to escape look. Sorted thanks!
  11. D

    Parsing PGN files

    I'm very nearly there. :) Only problem I am getting is that it does not get the very last line of moves, but only on the very last game. It gets the moves for the earlier games ok. Any idea why? 'Cycle through lines For i = 0 To UBound(var) 'Check if Move line If...
  12. D

    Parsing PGN files

    Is this syntax correct for checking if both a "." exists and a "[" doesn't exist in the string? If (InStr(var(i), ".") = True) And (InStr(var(i), "[") = False) Then
  13. D

    Parsing PGN files

    My idea was if a line of data has a "." in it but no "[" or "]", then its a line of moves. However, my problem is with it spread over several lines and concatenating them
  14. D

    Parsing PGN files

    gemma-the-husky, the whole move sequence is to go in a single string. It doesn't need splitting up. I agree that is the fiddliest bit!
  15. D

    Parsing PGN files

    Is the Move Parsing Engine going to split out each move? I only need all the moves into the same field. i.e. I would want all this... ...going into the string $mymoves to then populate a memo field. I don't want to have c4 in a field in record 1, then c5 in a field in record 2. Does the Move...
  16. D

    Parsing PGN files

    This is my routine so far but I don't seem to be triggering the parsing engine section! Private Sub cmdParse_Click() Dim strPGNdata As String Dim vGame Dim vTurn Dim vMove strPGNdata = PGNdata Dim var var = Split(strPGNdata, vbCrLf) 'show the contents of the array Dim i As Integer For i =...
  17. D

    Parsing PGN files

    I love the sound of a "parsing engine"! Thanks for your help guys. Will take it for a spin and see what I end up with.
  18. D

    Parsing PGN files

    So check the current array row for a dot. If it has one then check the next array row for a dot. If there is a dot there, then add them together. Then check the next row. That kind of thing?
  19. D

    Parsing PGN files

    Things are going in a little slowly today since I am shattered... I am a little unsure of what you mean by the pairs. Do you mean try to look for 1. f4 d5, then check for a dot in the next few characters, if there then you will add 2. Nf3 Nc6, then check, then add 3. e3 Bg4. Is that what you mean?
  20. D

    Parsing PGN files

    All the moves go in the same field. But the format of some PGN files have the moves line-breaked rather than one continuous line. That is a tricky bit!
Back
Top Bottom