import text longer than 250 chars to comments

uulbrichuulbrich Member Posts: 7
edited 2002-01-25 in Navision Financials
We need to import text from our old CRM system to Navision comment fields wicht are limited to 80 chars. The idea is to split the text to multiple lines but how to deal with a 250+ char string in a dataport. Any ideas?

Uwe <img border="0" title="" alt="" src="images/smiles/icon_confused.gif" />

Comments

  • John_TegelaarJohn_Tegelaar Member Posts: 159
    Solution 1: Use Attain (1024 characters allowed)

    Solution 2: If you can isolate the text to import, you could create a codeunit to read from the file(s) step by step. Using a variable of type Binary, you can read chunks of up to 2000 bytes from the file (with "importfile.READ(bin_var)" method). From this binary variable, you can parse out the text character by character ( with LineText := LineText + FORMAT(bin_var[index]) method. This also allows you to do some formatting checks, like "if bin_var[index] = 13 then New_line").

    John
  • uulbrichuulbrich Member Posts: 7
    Thanks, John. We'll try. BTW, we have Attain here but it seems there are a few too new things in it for our consultants.

    Uwe <img border="0" title="" alt="" src="images/smiles/icon_wink.gif" />
  • RobiRobi Member Posts: 4
    We also use attain (3.01.B) and I tried to import tab delimited file with one field cca 700 chars long.

    I defined a Text variable of 1024 length and set it as dataport field.
    But when it comes to import Attain truncates this into 254 chars and there's nothing I can do about it.

    The other soultion I'm trying to do is use excel to split this long field into more fields of 250 cahrs and then import it.

    Anybody knows more ?
    ®obi
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Try replacing the blancs in your ASCII-file with a certain character (eg. #). Then, after importing in Navision, you can change that character back to space.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
Sign In or Register to comment.