Aloha! I have a data file (.dat) that has about 3000+ lines of data that has the format for the first few characters - Position Field Name Length Description
-
01-14 Item # 9(14) Item Number
-
15-19 Vendor 9(05) Vender/Manufacturer ID Number
-
20-44 Model # x(25) Manufacturer Model Number
-
45-60 UPC 9(16) Universal Product Code
-
61-62 Buy Dept x(02) Wholesale buying department
It actual goes to 500 characters in each lines with 70 different fields.
Can someone please help me out and start me out in how to go about parsing the data automatically and put the data in respective fields (or columns) for each item number in Excel? Or maybe the program will automatically create a file (that is delimited that can then be imported into Excel?
Mahalo! I really don't want to count each record byte by byte.
5 6342
Does it have to be done in VB? Perhaps you can just do a text import (with fixed-length fields) in Excel.
Does it have to be done in VB? Perhaps you can just do a text import (with fixed-length fields) in Excel.
Thank you for your response. I think I can do it with text import, but how do I automate it every time I get this file (it is a retail store file that has about 500+ fields and headquarters sends the file every week)? There's got to be an easier way.
Mahalo! (Thank you!)
Thank you for your response. I think I can do it with text import, but how do I automate it every time I get this file (it is a retail store file that has about 500+ fields and headquarters sends the file every week)? There's got to be an easier way.
Well, I just started recording a macro then imported a text file, defining some fixed-width fields. Here is what was generated. This should give you some info to work from... - Workbooks.OpenText Filename:="C:\Sample.TXT", Origin:=xlMSDOS, StartRow _
-
:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(2, 2), Array( _
-
6, 1)), TrailingMinusNumbers:=True
If you need to know more about the parameters, look them up, or try importing with different settings and see what changes in the recorded macro.
Well, I just started recording a macro then imported a text file, defining some fixed-width fields. Here is what was generated. This should give you some info to work from... - Workbooks.OpenText Filename:="C:\Sample.TXT", Origin:=xlMSDOS, StartRow _
-
:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(2, 2), Array( _
-
6, 1)), TrailingMinusNumbers:=True
If you need to know more about the parameters, look them up, or try importing with different settings and see what changes in the recorded macro.
Mahalo!
I think you and I were on the same page! I tried importing it with the macro recording on and after several times I think I have it all finished the parsing correctly! Thank you sooo much for steering me in the right direction!!!
Mahalo!
I think you and I were on the same page! I tried importing it with the macro recording on and after several times I think I have it all finished the parsing correctly! Thank you sooo much for steering me in the right direction!!!
Glad to help! :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Phil Powell |
last post by:
What would one best recommend to parse an existing Excel spreadsheet (was
done in Excel 97 or 2000 not sure to be honest)? I am looking for the most
practical way of parsing an existing...
|
by: Kylotan |
last post by:
I have a text file where the fields are delimited in various different
ways. For example, strings are terminated with a tilde, numbers are
terminated with whitespace, and some identifiers are...
|
by: Hugh McLaughlin |
last post by:
Hello Everyone and thanks for your help in advance. I am
working on an application that requires the parsing of an
Excel spreadsheet that will be loaded into a SQL Server
table. An example of...
|
by: Andre Ranieri |
last post by:
I'm having trouble programatically inserting an Excel file into an Image column in our CRM package's SQL 2000 database. The function appears to work ok, but when I attempt to access the file through...
|
by: jetaw03 |
last post by:
guys, can you help me to get data from a text file and putting it in an excel file? my programming language is visual basic 6.0
here is a sample data from the text file:
...
|
by: jetaw03 |
last post by:
guys, i need help in using VB 6.0.can you help me to get a data from an excel file from ms access and put it in ms excel..pls help me guys..
here is the sample of the file in access:
sum1 sum2...
|
by: JJ |
last post by:
Whats the best way for me to pull out records from a tab delimited text
file?
Or rather HOW do I parse the text, knowing that the tabs are field
delimiters and a return (I image) signifies a new...
|
by: Bruce_Stough |
last post by:
I am currently using Control.DoDragDrop to drop a text string into Excel. I
use the following code
DataObject dd = new DataObject();...
|
by: treybraid |
last post by:
My Flash file is a GameCenter where team standings are kept.. I have it set up right now with the master spreadsheet programmed that is linked to a dummy sheet that is saved as a CVS doc and loaded...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |