[AccessD] Edit Large Text Files (was:Treat string as array)

Mark A Matte markamatte at hotmail.com
Mon Mar 24 14:08:41 CDT 2008



Michael,

I don't think that is what JC needs...but I regularly deal with large text files that are not fixed length.  (2+ gigs).  I looked at the tool referenced below.  I ended up (with the help of AccessD)...creating my own process.  Its not pretty or documented...but I can do a search and replace in under 30 seconds on a 2 gig file.  

I use the same concept as the tool below...I count the bytes.  

I first use my process to replace some 'known' annoying characters...then I try to import into SQL...when it errors...it tells me the row number.  I use access to link to the file...goto the area...and look for the anomoly and copy some 'unique' text from that area.  I then modify my process to find the 'unique text' and only write that chunk to a text file(about 10 meg).  I open this file...find the area in question...then look for the problem...sometimes its missing delimeter, extra delimeter, or just some character it does NOT like.  Once this is isolated...I run my search replace on the 'isolated' text.  Then I try to import again.

Currently to do the whole thing...In my code I just comment out the feature I'm not using...so its not quite obvious what I'm doing(emergency coding).  I can try to clean it up a bit if you are interested...or even a 5 min call to walk through it.

Let me know.

Mark A. Matte
336/253-5270


> From: mmattys at rochester.rr.com
> To: accessd at databaseadvisors.com
> Date: Mon, 24 Mar 2008 13:18:22 -0400
> Subject: Re: [AccessD] Treat string as array
>
> I'm going to be looking at this TextTool.mdb for some ideas
> on cleaning up imported textfiles. Looks like the GetBytes routine
> might offer a method for you - dunno.
>
> http://www.freevbcode.com/ShowCode.Asp?ID=3280
>
> Michael R. Mattys
> MapPoint & Access Dev
> www.mattysconsulting.com
>
> ----- Original Message -----
> From: "jwcolby" 
> To: "'Access Developers discussion and problem solving'"
> 
> Sent: Monday, March 24, 2008 12:49 PM
> Subject: Re: [AccessD] Treat string as array
>
>
>> Michael,
>>
>> Split() only works on delimited strings. It is designed to break a string
>> of words (for example) into an array of the words. In that case it would
>> use the spaces as the delimiter.
>>
>> I am trying to take any string and put the INDIVIDUAL CHARACTERS OF THE
>> STRING into INDIVIDUAL ELEMENTS of an array. If I gave you a string of
>> "12345asdfg" and you pass that to split you would get (I assume)
>> "12345asdfg" back in one element of an array. I need 1 in the first
>> element, 2 in the next element, 3 in the next element etc.
>>
>> Go back to the very beginning of this thread and look at what I asked for.
>>
>>>> How can I turn a string into an array? I need to iterate through the
>>>> characters of a string.
>>>>
>>>> For each char in str
>>>> dosomething char
>>>> Next char
>>
>> Arrays have iterators (for each next). Strings do not.
>>
>> John W. Colby
>> Colby Consulting
>> www.ColbyConsulting.com
>> -----Original Message-----
>> From: accessd-bounces at databaseadvisors.com
>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Bahr
>> Sent: Monday, March 24, 2008 12:37 PM
>> To: Access Developers discussion and problem solving
>> Subject: Re: [AccessD] Treat string as array
>>
>> Ok, but the principles still apply. Try this
>> http://www.vbforums.com/showthread.php?t=470268
>>
>> and for reference
>> http://www.codeguru.com/forum/archive/index.php/t-250108.html
>> http://www.thescripts.com/forum/thread13305.html
>>
>> Mike...
>>
>>
>>> Thanks. VBA.
>>>
>>>
>>> John W. Colby
>>> Colby Consulting
>>> www.ColbyConsulting.com
>>> -----Original Message-----
>>> From: accessd-bounces at databaseadvisors.com
>>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael
>>> Bahr
>>> Sent: Sunday, March 23, 2008 8:21 PM
>>> To: Access Developers discussion and problem solving
>>> Subject: Re: [AccessD] Treat string as array
>>>
>>> JOhn, take a look here
>>> http://www.thescarms.com/dotnet/dotnetstring.aspx
>>>
>>> Mike...
>>>
>>>
>>>> How can I turn a string into an array? I need to iterate through the
>>>> characters of a string.
>>>>
>>>> For each char in str
>>>> dosomething char
>>>> Next char
>>>>
>>>> John W. Colby
>>>> Colby Consulting
>>>> www.ColbyConsulting.com
>>
>>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com

_________________________________________________________________
Test your Star IQ
http://club.live.com/red_carpet_reveal.aspx?icid=redcarpet_HMTAGMAR



More information about the AccessD mailing list