locked
Import text file to Foxpro each Char is column RRS feed

  • Question

  • Hey everyone

            I have a problem importing a text file. The file is actually in .DAT format but i dont think that makes a difference.

    I import it using Delimited. But it arranges the columns different.

    My question: Can I import the file so that every letter or space becomes a column of its own

    Side Q. Can foxpro do something like Vlookup. I need Data from another txt file and but I want to look up ID # from the first table to another one.

                               ID     G   Code

    Ex Table 1.       14032      UB30

          Table 2.      14032  2  UB30

    I need the 2 to go to table one. I know i can join some columns together using select statment but first I every character to be its own column. Then i plan to Vlookup ID and insert the "2".

    Thanks

    Friday, August 10, 2012 4:18 PM

Answers

  • If the columns are evenly spaced, you can read one line at a time using the fgets() function and then parse your line using substr.

    HTH


    Mike z

    Friday, August 10, 2012 4:38 PM

All replies

  • If the columns are evenly spaced, you can read one line at a time using the fgets() function and then parse your line using substr.

    HTH


    Mike z

    Friday, August 10, 2012 4:38 PM
  • I don't think there's a standard .DAT format, so show up a little of your data.

    Tamar

    Monday, August 13, 2012 8:11 PM
    Answerer