Avoiding FieldStartDelimiter and FieldEndDelimiter?

rocopsa
Member Posts: 38
Dear experts,
I'm developing export function into TXT (Tab Delimit) files and encounter a problem.
Since I have a field having length over 250, I can neither use dataport nor ExcelBuff. So, I have created a codeunit and written all the necessary CreateBook, CreateSheet, SaveAs .TXT codes, etc by myself.
It was fine and successful BUT.... the output data includes a doublequot (") at the start and end of the field value which having comma (,). That's the problem I am encountering.
The SaveAs code as follows:
XlWrkBk.SaveAs(<full file path name>,-4158);
In which, -4158 is xlFileFormat - xlCurrentPlatformText.
Actually, I have tried other Text fileformat but in vain.
19, 20, 21, 42 - all error;
36 Printer Text can avoid the double quotation, BUT,..... did not use TAB as delimiter.
So, if any one of you have ideas on that, please kindly advise! [-o<
Thanks in advance,
Rocopsa
I'm developing export function into TXT (Tab Delimit) files and encounter a problem.
Since I have a field having length over 250, I can neither use dataport nor ExcelBuff. So, I have created a codeunit and written all the necessary CreateBook, CreateSheet, SaveAs .TXT codes, etc by myself.
It was fine and successful BUT.... the output data includes a doublequot (") at the start and end of the field value which having comma (,). That's the problem I am encountering.
The SaveAs code as follows:
XlWrkBk.SaveAs(<full file path name>,-4158);
In which, -4158 is xlFileFormat - xlCurrentPlatformText.
Actually, I have tried other Text fileformat but in vain.
19, 20, 21, 42 - all error;
36 Printer Text can avoid the double quotation, BUT,..... did not use TAB as delimiter.
So, if any one of you have ideas on that, please kindly advise! [-o<
Thanks in advance,
Rocopsa
0
Answers
-
Maybe you should look into writing the file yourself using File and Outstream, instead of relying on Excel to do it for you. It'll be a little bit more work, but you are in control of what you want to output.0
-
In Excel, if you use Data -> Import External Data -> Import Data, then on the second page of the wizard you can define what field value delimiter to use."Money is likewise the greatest chance and the greatest scourge of mankind."0
-
einsTeIn.NET wrote:In Excel, if you use Data -> Import External Data -> Import Data, then on the second page of the wizard you can define what field value delimiter to use.0
-
Dear all,
Thanks for the idea!!! I will try to look into FILE and outstream instead.
\:D/
Cheers!
Rocopsa0
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