XML reads an entire file as one record, no line breaks / carriage return

Village_Idiot
Member Posts: 16
Hi everyone
My customer has given me a file downloaded from their banking Site which, on import, is read as one single row / line even though the file has 85 rows of data. I opened the file in different text file readers, textpad and notepad++ and notepad and it clearly has rows of data...
How can I split the line at every 40th character while reading it in?
Hope someone can help.
My customer has given me a file downloaded from their banking Site which, on import, is read as one single row / line even though the file has 85 rows of data. I opened the file in different text file readers, textpad and notepad++ and notepad and it clearly has rows of data...
How can I split the line at every 40th character while reading it in?
Hope someone can help.
0
Best Answer
-
I have resolved this issue by setting a char limit/ length on the Integer table width. This seems to make sure that each row is cut off at 40.0
Answers
-
Hi,
Don't process xml as a text file. Use an XMLPort or some Dotnet XML parser. XML does not need line breaks in order to mark-up records of a table.
Your XML-file, if it has line breaks indeed, probably uses Unix style line breaks (<LF> only, rather than windows standard <CR><LF>). An XML parser is required to convert line breaks to this format anyway, so, why not store it this way in the file in the first place.0 -
I have resolved this issue by setting a char limit/ length on the Integer table width. This seems to make sure that each row is cut off at 40.0
-
True, that's absolutely the worst idea. Don't treat XML like a glorified text file... Like so many have done in the past. Properly parse it as XML.0
-
The file is text, not XML.0
-
i am doing that. the problem is solved0
-
Village_Idiot wrote: »i am doing that. the problem is solved
Hi Village_Idiot,
I see that you already resolved your problem. But If you want to resolve it properly, then:
1- Check your file with notepad++ (or equivalent). Show the special characters and see what is the return carriage on your file (CR, LF, CRLF ... or other)
3- Check "RecordSeparator" property on your XMLport and set it to the adequate value from your file (By default it equals <<NewLine>>).
The help says:
0 -
nabil.bamoh@hotmail.com wrote: »Village_Idiot wrote: »i am doing that. the problem is solved
Hi Village_Idiot,
I see that you already resolved your problem. But If you want to resolve it properly, then:
1- Check your file with notepad++ (or equivalent). Show the special characters and see what is the return carriage on your file (CR, LF, CRLF ... or other)
3- Check "RecordSeparator" property on your XMLport and set it to the adequate value from your file (By default it equals <<NewLine>>).
The help says:
Thank you. You will notice in my very first post, I have written that I used notepad++ to check the file. and i did set record separators. Nothing worked until I set a limit on the record. It seems to work.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