Hi, Does the FieldStartDelimiter and FieldEndDelimiter work? I have tried dataporting a *.csv file. if any of the fields in the *.csv file uses <"> then the dataport will have a problem. eg. if navision is attempting to dataport a text <15" Monitor> then the dataport would give out an error… and of course to proceed, i will have to remove all the <">'s from the *.csv file. should this be happening in navision’s dataport?
If I remember correctly, Dataports will process fields right on through without hesitation, even if they contain the start and end delimiters. This, of course, results in the problem you describe. But, for me at least, use of different start and end delimiters (and they don’t need to be the same) did work, (so did the other properties). Dave Studebaker das@libertyforever.com Liberty Grove Software A Navision Services Partner
I find it a whole lot easier to use the tildy (~) as a field separator within the .csv/.txt file, and not use the delimiters. That way, the chances of you having an error are a heck of a lot less likely, because usually no one uses the tildy in data files. Of course, you should check your data file in something like Excel before attempting the import Dataport. To use no delimiters in the dataport, I found you must specify within the setting. Just leaving it blank will revert back to <">, and just typing None will result in the dataport looking for None as a delimiter at the beginning and end of the field (crazy, isn’t it?) Regards. Kristopher Webb Kelar Corporation, Canada
A few things I have done to help make import data a little easier. I Always have the same number of input strings to the number of fields you are importing. When ever possible I like to have the TAB has the field delimiter. I don’t know why but some times adding a string to the Dataport fields called EndOfReord (30 length) has solved a lot of problems for me. Regards CBS Sverige AB +46(0)8 764 74 25 graham@cbs.se
I have found that ~ works well as a field separater and | as a delimiter. I have also added a function (if the export is out of navision) that “cleans” text fields of the | & ~ before exporting them. Bill Benefiel Manager of Information Systems Overhead Door Company billb@ohdindy.com (317) 842-7444 ext 117
Excellent ideas!! I especially like the “cleaning” idea and, with Bill’s permission, will appropriate that one. Dave Studebaker das@libertyforever.com Liberty Grove Software A Navision Services Partner
I can send you function if you want. It’s just a few lines. Bill Benefiel Manager of Information Systems Overhead Door Company billb@ohdindy.com (317) 842-7444 ext 117
We do a lot of dataporting using Excel’s “Save as Text (TAB delimited)” filetype to create the source files. This puts the text on disk without field delimiters (no hassle with any character in the data), plus the TAB character as field separator (also safe - Excel allows no TAB inside a cell). At the Navision side, you set the Field Delimiters to (note: spelled exactly this way, brackets and capital N inclusive) and Field Separator to (again, exactly spelled as shown here). This is not only a perfect match with the Excel file format at import, but when exporting it’s also providing a format which Excel can read “without questions asked”. John
Fellows, John’s advice is excellent, and I highly recommend it. Two issues though: 1) From Excel, “Save as” with file type “Text(MS-Dos) (*.txt)”, which is down in the bottom of the file type list. It will take care of localized caracters like ü, é etc. Thje ordinary Save as text doesn’t. 2) Search and replace the Excel text columns for ’ and " (single and double quotation marks), as these tend to create problems. Just replace them with nothing. To simplify creating new dataports, always copy an existing (Design, Save as), and you don’t have to worry about these genaral format settings any more. Pelle
quote:
Kristopher wrote: To use no delimiters in the dataport, I found you must specify within the setting. Just leaving it blank will revert back to <">, and just typing None will result in the dataport looking for None as a delimiter at the beginning and end of the field (crazy, isn’t it?)
I’ve been using none delimiters a lot of times and they didn’t gave me any error… is just writing in the delimiter fields and it’s working fine (having to write the <> simbols also…) If you’re using data that’s having quotes (doubles or singles) on the data, a usual thing that works fine is the pipe simbol ( | ). If you know exactly the size the fields will have, another way is using fixed sizes of the fields instead of variable. Alfonso Pertierra (Spain)apertierra@teleline.es
HI ALL These are good infos about Dataport! But one thing is left: How can i tell Navision to use a BLANK (1 Space) as FieldDelimiter ??? THANKS!
- Set the default FieldDelimiters to . 2. On each field in the dataport enter the following code in the OnAfterFormatField trigger: Text := ’ ’ + Text + ’ '; I fail to see why you’d want to use a space as FieldDelimeter, though. Potentially this could cause a lot of problems.
Thanks for your idea! I have a external file (not from me and i cant change the format). I want to import this file into Navision. The Problem is that in the file the fields are separated by blanks (space). Some Fields have no Fieldstart/-enddelimiter some use " and some fields are used with [] (brackets). Thats the mainproblem i have with the file!
Well, in that case space is the FieldSeparator (not the FieldDelimiter). The above solution won’t help since it works only on FileExport. You have 2 options: 1. Use FileFormat = Fixed (if that’s the case) and get rid of any unwanted characters after import (You can use OnBeforeEvaluateField). 2. Write a report that does the job - this can be tedious, especially if the linelength exceeds 250/1024 characters.
To write data to a file I use @@ as delimiter and a semicolon as separator. If you read such data into excel define the semicolon and the @ as delimiter. After reading the data select the columns with only @ and delete them. In this way no export from navision to excel ist ever stopped.
This is something that I am considering at the moment, whereby I need to export information using ~ as a seperator and delimiter. However I am a bit ignorant about this, can you define this in the dataport properties (i.e. <~>) as when I have done this, the exported file just repeats the <~> and creates one record in one cell in a .csv file.
Could someone let me know how Navision supports the tilda delimiter or where I am going wrong
Thanks
Ben
Best way in my experience:
as field separator
as field start and end delimitors
Everything else has given me problems, including funky key combinations.
Just use the tilde character without the brackets.
Also worth noting that if you have a decent text editor, you can make the output into an old standard format “quotes, commas” ascii by using the carot ^ and tilde ~ as delimiters and seperator, then in the text editor, find all the " and , and replace with a space. Then replace all the ^ with " and ~ with the comma.
CGB
You do not have to use the <> to contain the tilde or any other character.
I use the ¬ and ^ or ~ and it is fine for transfer between NAV tables.
The real problem is that everyone who uses Excel will know that that dreadful product will not give you the opportunity to use your own characters, you are stuck with TAB or comma.
Comma is a pain so just go with tab.
To use that, as TAB is not a character, you must enclode in and use for the start and end delimiters as previously mentioned.
Actually Excel handles any delimiter just fine. Maybe it didn’t in older versions, but there is an “Other” check box where you can specify the delimiter when opening the text file in Excel.