Re: Extract same text from file.

From: Josef Moellers (josef.moellers_at_fujitsu-siemens.com)
Date: 08/16/04


Date: Mon, 16 Aug 2004 11:52:36 +0200

Ryan Keeling wrote:
> Hi
> I have the following text file which I want to use to populate text
> files containing data only relevant to a particular project. Is it
> possible for me to group similar lines together and put them in their
> own text file? Such as a file containing all entries for
> MS102_PCP.Implementation and another file for MS102_PCP.Support.
>
> Any help would be greatly appreciated!
>
>
> 2004:01:07:3:02:MS102_PCP:Belfast:Charge:PCP:Implementation:+:5.5
> 2004:01:07:3:02:MS102_PCP:Belfast:Charge:PCP:Support:+:2.0
> 2004:01:05:1:02:MS102_PCP:Belfast:Charge:PCP:Implementation:+:7.5
> 2004:01:09:5:02:MS102_PCP:Belfast:Charge:PCP:Meetings:+:1.0
> 2004:01:20:2:04:MS102_PCP:Belfast:Charge:PCP:Standards:6.5
> 2004:01:19:1:04:MS102_PCP:Belfast:Charge:PCP:Standard:7.5
> 2004:02:03:2:06:MS102_PCP:Belfast:Charge:PCP:Support:+:2.0
> 2004:03:02:2:10:MS102_PCP:Belfast:Charge:PCP:Implementation:+:5.5
> 2004:03:03:3:10:MS102_PCP:Belfast:Charge:PCP:Implementation:+:7.5
> 2004:03:02:2:10:MS102_PCP:Belfast:Charge:PCP:Support:+:2.5
> 2004:03:26:5:13:MS102_PCP:Belfast:Charge:PCP:Support:+:7.5
> 2004:03:29:1:14:MS102_PCP:Belfast:Charge:PCP:Support:+:8.0
> 2004:03:30:2:14:MS102_PCP:Belfast:Charge:PCP:Implementation:+:8.0
> 2004:01:05:1:02:MS102_PCP:Belfast:Charge:PCP:Project-Control:+:7.5
> 2004:01:06:2:02:MS102_PCP:Belfast:Charge:PCP:Meetings:+:2.0
> 2004:01:06:2:02:MS102_PCP:Belfast:Charge:PCP:Meetings:+:0.7

Answer to your question: yes.

Obvious counter-question: what have you tried so far and where have you
had problems?

Since your data is reasonably structured, I'd use split and then create
a filename from fields 8 and 9 to append the current line to. If the
data isn't too much, you can use a hash of arrays to collect the data
and write it out in one go.

-- 
Josef Möllers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett


Relevant Pages

  • Re: Sorting recordsets
    ... > ' Create an empty recordset for the results ... > .Append "accountCount", adBigInt ... > .Append "latestOrderDate", adDate ... > I populate it with rows. ...
    (microsoft.public.data.ado)
  • Re: Extract same text from file.
    ... Ryan Keeling wrote: ... > I have the following text file which I want to use to populate text ... use strict; ... use warnings; ...
    (comp.lang.perl.misc)
  • Re: Access 2000 Appending records to a table
    ... So I would like to append the record with the data that is available at ... fields just to populate the blanks, ... around this process of adding bogus data just to poplate the fields so the ... append query works? ...
    (microsoft.public.access.security)
  • Re: Probably an easy one for ya - File Associations
    ... Tim Geiges wrote: ... > filename or text. ... > is there a property I need to populate, I have the Text property filled. ... If replying to the group, please do not mail me too ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Populating a table when a new record is entered in a form
    ... The user should populate four fields at which time when a ... > combo is populated it should trigger the After Update and run an append query ... Prev by Date: ...
    (microsoft.public.access.forms)