So that I'm understanding correctly, there are spaces after the Y character
that separate it from the 1 that is on the next line in the posted message
(because of line wrapping), and the same for the last 7 on the "second line"
and the 0 on the "third line", is this correct?
Before we get into parsing, however, because you're using the TransferText
action to import that file, we can avoid this entire parsing action entirely
if you create an import specification that will parse the text record into
separate fields for you, and then you can use that import specification in
the TransferText action and the data will be separated for you.
You say that the data record is a fixed-width. And it appears that you want
to extract three "parts" of the record for your use. Thus, what you really
want to do is to split the record into five fields; e.g., from the example
that you posted, you want the "2322", the "Y", and the "066" portions only.
So, before we begin this process, I need you to do the following: identify
the exact character positions that will contain the "2322" value in each
record (meaning, the value is in positions 25 throgh 28, or it's in
positions 23 through 28, or it's in positions 25 through 29, etc.); then
identify the exact character positions that will contain the "Y" value
(earlier, you'd mentioned HH3H5A instead of Y?); then the exact character
positions that will contain the "066" value.
Identify those "windows" and then we'll continue.
--
Ken Snell
<MS ACCESS MVP>
Curie said:
The article are on
http://support.microsoft.com/?id=306144. I used the
code
to change the extension. Yes, the DAT file is the one I have to deal with
it
(i.e., convert to TXT file) before I can do anything else. Here is the
data
after I ran the code to import the DAT file in to one field of a table.
----------------------This is just for
example------------------------------
111112222233344444545Y 2322 #1112 Y
123456789021345678900123455667788990012344434544544545467777
066
-----------------------------------------------------------------------------------
The data will line up becoming a single line in a table after importing. I
need to extract, for example, 2322, Y, and 066.
How can i do that?
Thanks,