Importing file with | as a field seperator

tabularasa
Member Posts: 22
Hello guys.
I'm using xml port to import file that has | as a seperator and obviously without success. Anyone that know's about a workaround other than changing the file. I can import this if I change the file to a Tab delimited file.
I'm using xml port to import file that has | as a seperator and obviously without success. Anyone that know's about a workaround other than changing the file. I can import this if I change the file to a Tab delimited file.
0
Comments
-
Are you running it on RTC or classic? XMLPort can be used for other type of files but only on RTC not in classic. In classic it can only be used for xml files.0
-
I'm running the xml port from rtc.0
-
ara3n wrote:Are you running it on RTC or classic? XMLPort can be used for other type of files but only on RTC not in classic. In classic it can only be used for xml files.
Are you shure about this. Isn't it possible to run a xml port through code units called from f.eks. application server that would import or export flexible text file.0 -
I don't know what f.eks is but even on NAS it only will run xml file types.0
-
I have a question for Microsoft - I hope one of their people is monitoring this.
If dataports are going away in version 7, then how will we handle text file imports using Navision Application Server (NAS) if NAS does not support using xmlports for text file imports?
Does Microsoft plan to add this capability or will NAS be replaced by another 3 tier client for handling background batch processing?
Or is this "Whoops - this never occurred to us?"David Machanick
http://mibuso.com/blogs/davidmachanick/0 -
But what about using | as a field seperator any idea how that can be done.0
-
davmac1 wrote:I have a question for Microsoft - I hope one of their people is monitoring this.
If dataports are going away in version 7, then how will we handle text file imports using Navision Application Server (NAS) if NAS does not support using xmlports for text file imports?
Does Microsoft plan to add this capability or will NAS be replaced by another 3 tier client for handling background batch processing?
Or is this "Whoops - this never occurred to us?"
You connot run dataport on NAS.0 -
As I have just found, you can import a flat file with XMLPort in RTC... but only, apparently, in RTC. That is, running my XMLPort in 2009 Classic gets a 'format error, column 1 line 1', but it works properly in RTC.
Heres how it's working for me: I'm importing this flat file into Payroll Journal Lines:
"PAYROLL","10000","11",11/30/2010,"Payment","Regular Hours",11/30/2010,"WEEKNEW","DRIVERS","25.49"....
"PAYROLL","20000","139",11/30/2010,"Payment","Regular Hours",11/30/2010,"WEEKNEW","PRODUCTIN","29.011"....
"PAYROLL","30000","14",11/30/2010,"Payment","Regular Hours",11/30/2010,"WEEKNEW","SUPERV","30.18"....
"PAYROLL","40000","170",11/30/2010,"Payment","Regular Hours",11/30/2010,"WEEKNEW","DRIVERS","40.00"....
"PAYROLL","50000","170",11/30/2010,"Payment","Overtime Hours",11/30/2010,"WEEKNEW","DRIVERS","01.37"....
"PAYROLL","60000","18",11/30/2010,"Payment","Regular Hours",11/30/2010,"WEEKNEW","MECH","36.18"....
Here are the corresponding lines in my dataport grid:Node Name Node Type Source Type Data Source Root Element Text <Root> PayrollJournalLine Element Table <Payroll Journal Line>(Payroll Journal Line) JournalTemplateName Element Field <Payroll Journal Line>::Journal Template Name LineNo Element Field <Payroll Journal Line>::Line No. EmployeeNo Element Field <Payroll Journal Line>::Employee No. PostingDate Element Field <Payroll Journal Line>::Posting Date DocumentType Element Field <Payroll Journal Line>::Document Type Description Element Field <Payroll Journal Line>::Description PayPeriodEndDate Element Field <Payroll Journal Line>::Pay Period End Date PayCycleCode Element Field <Payroll Journal Line>::Pay Cycle Code] PayrollPostingGroup Element Field <Payroll Journal Line>::Payroll Posting Group HoursMinutes Element Field <Payroll Journal Line>::Hours.Minutes ....
No global or local variables are needed. In the XMLPort properties set "Format" to "Variable Text". I have "field separator" as <,>; for pipe-separated I assume you'd substitute <|>.
I'm still hoping for an answer here on how to work with these variables in code triggers, but this ought to get you started. Remember, run it from the RTC. You can use a codeunit or call it directly from a page action, setting the RunObject propery of the action to the name of your XMLPort.
Good luck...0 -
No global or local variables are needed. In the XMLPort properties set "Format" to "Variable Text". I have "field separator" as <,>; for pipe-separated I assume you'd substitute <|>.0
-
As I mentioned before xmlport in classic only run xml files.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions