Re: how to split a string using ,fixed character length, variable text delimmiter
- From: garyusenet@xxxxxxxxx
- Date: 6 Dec 2006 05:36:39 -0800
Thankyou for your replies. OK I have had another look at i think the
task has just got harder. The length isn't always 25 characters. But I
have found a pattern, hopefully this will help.
I am using this 'code' as a delimmiter because it always proceeds the
name of an item, and this file is essentially a database of items.
Following the name of an item, a number of item characteristcs specific
to that item are listed. Eventually the items characteristics are
completely listed and the next 'code' is encountered which proceeds the
next item in the database.
There does seem to be some identifiable traits of this code.
It appears to be always at least 20 characters long.
- The code is continuous there are no spaces present.
- It is always composed of letters ranging from A-Z, or numbers 0-9.
- The first two characters of this code are always letters raning from
A-Z.
- These two letters are repeated at least two other times during the
code.
e.g.
DODE86DODE86SZDO010144
So I guess what I am trying to do now is split the string, every time a
a string in encountered that is at least 20 characters long, is alpha
numeric, and has the first two letters repeated initself at least two
other times.
I think this is going to be tough?
Any ideas?
Thankyou-
Peter Bradley wrote:
How do *you* know it's a delimiter and not data?
In other words, if *I* were to look at the file, knowing nothing about it,
how could I tell what was a delimiter and what was data? How would you
explain to me what to look for?
When you can answer that, you can start thinking about how to pass that
information to a machine.
HTH
Peter
<garyusenet@xxxxxxxxx> wrote in message
news:1165409168.748251.240990@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm working on a data file and can't find any common delimmiters in the
file to indicate the end of one row of data and the start of the next.
Rows are not on individual lines but run accross multiple lines.
It would appear though that every distinct set of data starts with a
'code' that is always the 25 characters long. The text is variable
however.
Assuming i've read the contents of the file into the string myfile, how
do i split my file into an array, using this variable text, fixed 25
character long, delimiter?
Thankyou!
Gary-
.
- Follow-Ups:
- References:
- Prev by Date: Stored procedure with output parameter
- Next by Date: Re: Stored procedure with output parameter
- Previous by thread: Re: how to split a string using ,fixed character length, variable text delimmiter
- Next by thread: Re: how to split a string using ,fixed character length, variable text delimmiter
- Index(es):
Relevant Pages
|