Hello all, I am new here so I hope i do this in the correct forum.
I have an excel user who each week receives an EDI transfer of orders from one, two or three different companies. Each EDI may have one, two or all three depending. THere are only three companies ever.
The problem that I have is that the data is formatted so crazily that I need some major clean up module before I can import it into a database to work with the data. I am not even sure VB can do it. I have attached an example of the raw data and an example of the ideal data. The data always appears like this so one instance would work ongoing.
Essentially what I need to do is eliminate the crap rows of junk data and assign the company name and the "for" date to each part ordered so that the data would look like this
Company Name Date Needed Model Part
Company 1 7/10/2006 blah blah
Company 2 7/10/2006 blah blah
Company 3 7/10/2006 blah blah
Company 3 7/10/2006 blah blah
What you will see in the attachment is that the company name and date needed are listed in columns above all of the data that corresponds. Below the company in the same column can be either a number or the word "for" or "line" for some reason. I need to somehow take the company name and move it left and fill it down for the corresponding data (sheet two of the attachment shows how it would ideally look.)
If anyone can give me some direction with this I would be most appreciative or if you could direct me to something to read on this. ANYTHING closer would be greatly appreciated as well. ... Thank you in advance.
Have you considered opening it in Excel? Getting closer to the source of the creation would be ideal, since you'd have a better chance of dealing with it. If you open it in Excel and it appears... well, then you can use an Excel object to loop through it, and create your corrected text file.
Thank you both! I feel like we are getting somewhere. Yes I open the file in excel but you cant post excel files as attachments on this site. How would the module differ from the txt file module above? I want to go the most effective route.
But that is not an EDI transmission - that appears to be a report/list file from a mainframe type of machine.
You need to get rid of the headings - brucevde is showing you the logic to process, in a loop, and ignore meaningless lines...
Can you get that data without the headings?
If not I would develop a silly-little filter program to process the input file and give clean output from that. Then a bulk insert can be done from that clean file.
*** Read the sticky in the DB forum about how to get your question answered quickly!! ***
Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".
thanks! it is an edi report that is output into a text file. i can actually jsut disregard the headings. its not great for normalizaiton of data but it wont stop the process. Thank you very much!!!