Skip Line on Dataport

jayordan
Member Posts: 7
How would one skip a line on a data port import?
I have a tab deliminated file that includes a field that I want to use as an indicator to skip that line if it is 'Y'. I've stored that indicator to a global variable. I know I have to use an IF statement, but when I use the Record.NEXT function it doesn't skip the line completely.
I have a tab deliminated file that includes a field that I want to use as an indicator to skip that line if it is 'Y'. I've stored that indicator to a global variable. I know I have to use an IF statement, but when I use the Record.NEXT function it doesn't skip the line completely.

0
Comments
-
Just use the CurrDataport.SKIP in the OnAfterImportRecord when you need to skip the imported line (record).0
-
If YourGlobalVar = 'Y" then CurrDataport.SKIP;0
-
How to skip import the first line?
I try using this code below, but it's doesn't work.
IF CurrFile.POS = 1 THEN
CurrDataport.SKIP;
Any one can help me?0 -
Hello,
on PreDataItem insert this code:IF CurrDataport.IMPORT THEN BEGIN REPEAT CurrFile.READ(CharVar); UNTIL CharVar = 10; END;
CharVar - Char type variable
Have a good day.
Br,
Igor Beeone0 -
Igor Beeone wrote:Hello,
on PreDataItem insert this code:IF CurrDataport.IMPORT THEN BEGIN REPEAT CurrFile.READ(CharVar); UNTIL CharVar = 10; END;
CharVar - Char type variable
Have a good day.
Br,
Igor Beeone
Thanks it's work...
Can you explain this code.
Thanks.0 -
Hello,
OnPreDataItem trigger file is opened and ready to be read. Cursor of reading is in the beginning of file, so we just read characters from a file until end of line is found (The '10' denotes end-of-line).
So after this code, reading cursor is positioned on a second line, where dataport goes forward:)
That's all magic.
Br,
Igor Beeone0 -
Thanks a lot for your help0
-
Let's Link These:
Import dataport and skipping the header line
By Kriki in Tips N Tricks
http://www.mibuso.com/forum/viewtopic.php?t=105640
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