Options

Import Textstring >150 characters in multiple comment lin

voyager99voyager99 Member Posts: 15
Hi to All,

i want to import a text file with comments to customers.
the textfile contains the customer no. and a comment field >150 characters.
how can i create multiple lines in den comments-table during the import ? ](*,)

thanks

voyager99

Comments

  • Options
    WaldoWaldo Member Posts: 3,412
    Well, I had the same kind of problem recently with an access database. I had about 100 memo-fields to convert to multiple lines in Navision.

    If you are familiar with VB.NET:
    I took my WaldoNavPad, and I used the navpad-dll to write a seperate small program, which gave me a txt-file with the different lines. I just had to write the different SQL-statements, and the export/import only took a few hours.

    If not familiar with VB.NET:
    You can read it with a dataport into a 1024 variable, and write some code to divide it into seperate lines ... . Not sure this works, though...

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    Michael_SchumacherMichael_Schumacher Member Posts: 81
    Hello there,

    I had the same Problem with much longer texts, but I used XMLport.
    So there is the possibility to set the text to bigtext.
    Then I created some code to divide into seperate lines with search for a space to cut the line not in a word.
    in XMLPort this works perfectly.
    regards,
    Michael Schumacher

    oh, what day is it? Backup day. OK, let's dump all data to /dev/nul ;-)
  • Options
    ara3nara3n Member Posts: 9,256
    create global variable in the dataport. add the global variable to the dataport fieids. on after import trigger parse the global virable and insert into the customer comment.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    FeldballeFeldballe Member Posts: 26
    It is also possible to use streaming. An example is in order:

    flFile.Open('Filename');
    flFile.CreateInstream(isInstream);

    While Not (isInstream.EOS()) do
    Begin
    intCount := isInstream.Readtext(strContainer, 100)

    // Do something with strContainer

    End;

    flFile.Close();

    Note that the value '100' denote the length of strContainer.

    This basic routine makes it possible to do anything with any text regardless of length.
  • Options
    WaldoWaldo Member Posts: 3,412
    Not to promote the WaldoNavPad-dll but ... :oops:

    Note that when you cut-off at 100 characters, it may well be that you are going to cut off in the middle of a word. Using the dll, you can avoid this ... .

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
Sign In or Register to comment.