Hi Experts,
Need your help???
Have to create Processing only report, that will import ASC supported files. After the import stuff is done i have to parse the whole data and put it in a BLOB field.
So how do i get started; Any tips, Any trick any code sample?
Thanks
P.Edward
0
Comments
Thanis
If you're importing an ascii file, why do you need to put it into a BLOB field? And what's the purpose of storing data in the BLOB field? Do you need to spit it out afterwards?
Anywho, I would recommend doing the following:
1. Create a new table to store the ascii data you imported.
2. Do your processing based on the imported data on this new table
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
What i have to do is to import either a MS word file/wordpad file/notepad file through the report.
Then i have to parse that file and store the data as text in blob field.
I already have that blob field in one of my tables. I know how to retrieve the data from BLOB field.
But i want to know that how do i import those files through report and thn the parsing mechanism?
Waiting for your feedback
Thanks
P.Edward
Depending on that, you will have to use different import strategies:
a.) RTF files can be large, especially if binary embedded objects like images are included. Dealing with this type of document seems to be more complex
b.) XML can be imported by using the MSXML automation server
c.) binary files will require to iterate byte-by-byte through the import stream
In case of "normal" text files as saved by notepad or wordpad, you have to either know that they are plain ASCII, or in case they are somehow encoded, e.g. UTF-8, then during the import you also have to consider the encoding
The simple import can be handled like this:
Or you could use READTEXT in case you have CRLF separated text lines.
What you have to consider:
a.) for the parsing, you might need to use a buffer (the length depends on what you have parse) unless you can do it on the fly
b.) max. length for the text variable is 1024, maybe you need several variables for the parse buffer
c.) if the parts of the document mostly exceed a length of 1024, then you could also use a temporary stream and after filling it, you could use COPYSTREAM
In general, without knowing the content of the files or without providing examples, it's hard to propose an appropriate solution
MCP+I, MCSE NT, Navision MCT (2004,2005)
The files that i will import would be simple text (plain ASCII).
This is how my file would be
Date Subject Description
082807 Testing1 This text can go upto 10000+ characters
082807 Testing2 This text can go upto 10000+ characters
Now i have to parse that file, each new entry would be a new record. I have tried to use DataPort but i cant since the Description might go over 1024 characters.
Now in my table the Description is a BLOB field. What i have to do is to read the entire description of each record parse it and put it back in the BLOB field. I know how to put the data in BLOB field.
But i have never done the file import stuff before. So i am having trouble in importing the file and parsing it.
Another thing, i would be selecting a file dont have to put in the path.
Could you please do my a favour provide some code snippet so that i may start my hit and try.
Sorry for asking those basic things but honestly speaking i m doing that stuff for the first time; i really need your support.
Thanks a lot, waiting for your feedback.
Regards,
P.Edwards
Here a q&d version:
MCP+I, MCSE NT, Navision MCT (2004,2005)