Jump to content

Parsing data into new records?


This topic is 6118 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Do you know how to parse out text from a field that has a huge amount of text.

Each paragraph begins with a date, where I used a nested substitute calc to insert a "|" before each occurance of a date.

Now the task is to create a routine that would copy each paragraph, and create a new record from those paragraphs into another file.

Can anyone lend a clue please?

Link to comment
Share on other sites

In another text field, using that substitute function I mentioned earlier, I was able to get that data to appear as a separate record (starting with a date, etc), and I also added a carriage return char so the data looks more normalized.

The final result of this should show the following:

(client_id) (comments)

DOS100022 01/02/96 Bla Bla Bla This is some text

DOS100022 02/15/96 This is some more notes for this client

DOS100022 03/30/96 Some other notes

--

DOS100043 06/05/96 Notes on this other client

and so forth...

All this needs to go from a comments file, into a comments details file.

What am I missing? :-(

Link to comment
Share on other sites

Are there carriage returns WITHIN each set of parse data? If not and there are carriage returns BETWEEN each paragraph, you wouldnt even have to worry about it starting with a date.

You could just write a simple loop to parse it into separate records. Please report back.

Link to comment
Share on other sites

I created the followiing calc field to show each "paragraph" as a single item:

Middle( c_Comments_Add_Pipe,

Position( c_Comments_Add_Pipe, "¶", 1 , (g_loop_counter-1) )+1,

Position( c_Comments_Add_Pipe, "¶", 1 , (g_loop_counter) ) -

Position( c_Comments_Add_Pipe, "¶", 1 , (g_loop_counter-1) )-1

)

Now the task is to copy each one of these into the details file, as new record of the "client ID" record (like a line item).

I'm assuming a script that processes each paragraph as a new line item in details is what I need, but I'm not sure how to do it.

Also, when the routine gets to the last paragraph within that record in the main file, the script needs to start the next client id record and strip out the text and add it as a new record of the new client id in the details file.

Does this make any sense? :-!

Link to comment
Share on other sites

This topic is 6118 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.