Respondido convert csv to dbf file

  • Tuesday, May 08, 2012 10:50 AM
     
     

    any one can help me 

    how to converting csv to dbf file (or)

    how to convert datatable to dbf file 

    using c#.net

    • Moved by Rudedog2MVP Friday, May 11, 2012 12:52 PM : move to more appropriate forum : (From:Visual C# Language)
    •  

All Replies

  • Tuesday, May 08, 2012 11:00 AM
     
     

    can u help me 

    how to convert csv to dbf file (or)

    how to convert datatable to dbf file  using c#  (or)

    how to convert sql server   to dbf file


    • Merged by Rudedog2MVP Tuesday, May 08, 2012 6:53 PM : duplicate post is off-topic :
    •  
  • Tuesday, May 08, 2012 1:35 PM
     
     

    Something here might help. Which is it you want to do or is it all three?

    PS Don't re-post after 10 mins. I suggest deleting the previous one.


    Regards David R
    ---------------------------------------------------------------
    The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.
    Object-oriented programming offers a sustainable way to write spaghetti code. - Paul Graham.
    Every program eventually becomes rococo, and then rubble. - Alan Perlis
    The only valid measurement of code quality: WTFs/minute.


  • Tuesday, May 08, 2012 1:58 PM
     
     

    You should post your question here.

    http://social.msdn.microsoft.com/Forums/en-US/visualfoxprogeneral/threads 

    Use that forum issues with associated FoxPro databases.

    Hope this helps.

    Rudy   =8^D


    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.blogspot.com/

  • Friday, May 11, 2012 12:54 PM
     
     
    I have moved your thread to a more appropriate forum for issues associated with Visual FoxPro.

    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.blogspot.com/

  • Friday, May 11, 2012 3:28 PM
     
      Has Code

    Hi.

    To import from csv:
    * create a cursor or have a table ready and open in which to import to
    * note the fields of the csv must match the dbf or cursor
    * example below imports csv file with 2 fields

    create cursor impcurs(custnumber c(10), custaddr1 c(40))
    mycsvfile = getfile("CSV")
    if !empty(mycsvfile)
       wait window "Importing CSV File... " nowait
       APPEND FROM EVALUATE("mycsvfile") TYPE csv
       wait clear
    endif
    select impcurs
    browse normal
    

    *note you should put in additional error checking/validation but this should import your csv file

    HTH


    Mike z

  • Friday, May 11, 2012 5:09 PM
     
     Answered

    Mike

    That looks like xBase code, the OP wanted a C# solution (well I think they did, that's where they posted). However, they have not come back and said what they are trying to do. I guess either they have solved the problem or given up in despair. :)


    Regards David R
    ---------------------------------------------------------------
    The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.
    Object-oriented programming offers a sustainable way to write spaghetti code. - Paul Graham.
    Every program eventually becomes rococo, and then rubble. - Alan Perlis
    The only valid measurement of code quality: WTFs/minute.

  • Friday, May 11, 2012 5:14 PM
     
     
    Sorry Your right.

    Mike z

  • Friday, May 11, 2012 5:51 PM
     
     
    Not down to you Mike - it was moved here by a moderator and that's a natural reaction. No idea why it was moved given the last line of the OP. :)

    Regards David R
    ---------------------------------------------------------------
    The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.
    Object-oriented programming offers a sustainable way to write spaghetti code. - Paul Graham.
    Every program eventually becomes rococo, and then rubble. - Alan Perlis
    The only valid measurement of code quality: WTFs/minute.

  • Saturday, May 12, 2012 8:18 AM
     
     Answered

    To convert a CSV to DBF here is what I would do.

    IN VFP Comand Box

    Create a dbf temporary Table, define as many columns as there are number of commas in CSV

    append from <CSV FILE NAME> type CSV

  • Saturday, May 12, 2012 2:37 PM
     
     
    Does that work in C#? The OP originally asked for this in C#. Hence posted to C# forum. A Moderator moved it here, inappropriately in my view.

    Regards David R
    ---------------------------------------------------------------
    The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.
    Object-oriented programming offers a sustainable way to write spaghetti code. - Paul Graham.
    Every program eventually becomes rococo, and then rubble. - Alan Perlis
    The only valid measurement of code quality: WTFs/minute.