|
|
#1 |
|
Member
Join Date: Jun 05
Location: Poulsbo, WA
Posts: 60
![]() |
Howdee all
!I have an application that hacks down a text file for viewing/db import. While its working now(with help from folks here, thanks !) I have a new problem. one field that already gets seperated out for display/view needs to be refined further.There is a general text "block" that has to be seperated into three seperate text strings so the DB import can put them into the appropriate fields. The three strings have their own desiginator characters, and I thought I would just parse the string then hold them into seperate memory spaces via varible declarations in the import sub function. Problem is, I'm not sure how parse/seperate the text in VB6 because I'm THAT much of a newbie. The seperators are - No characters is the basic problem description that comes in originally. XXX denotes update remarks for the particular entry. /// OR \\\ denotes a close to the entry in question. EXAMPLE - Original problem gets listed, it's usually a fairly short string. XXX Problem gets some sort of update text. XXX Maybe some more update text gets added here. /// Then they close the problem report for that particular entry like this. Can anyone explain to me how to pull this off? John |
|
|
|
|
|
#2 |
|
Banned
Join Date: Jun 04
Location: Center of it all
Posts: 17,901
![]() ![]() ![]() ![]() ![]() ![]() |
Re: Isolating text strings from a file
Post a block that you want to parse
|
|
|
|
|
|
#3 |
|
Member
Join Date: Jun 05
Location: Poulsbo, WA
Posts: 60
![]() |
Re: Isolating text strings from a file
4320010205 N/ADURING NORMAL OPERATION, DISCOVERED MALFUNTIONING * IN SUPPLY OFFICE. UPON INVESTIGATION FOUND WORN GEARS DUE TO BROKEN TENSION SPRING.
XXX REQUEST NEW * FROM SUPPLY SYSTEMTO REPAIR STATION IN SUPPLY OFFICE.XXX SUPPLY INDICATES NO * LEFT ON BOARD, REQUEST TO RECEIVE PARTS DURING PORT CALL.\\\XXX PARTS RECEIVED ALL WORK COMPLETED, NO FURTHER ACTIONS REQUIRED. This is what one typically looks like. The * is text I removed. Can't let everyone see that stuff .The "XXX" at the end after "\\\" would be removed in the viewer before export. |
|
|
|
|
|
#4 |
|
Frenzied Member
Join Date: Jan 02
Location: Horsham, Sussex, UK
Posts: 1,519
![]() ![]() |
Re: Isolating text strings from a file
This is hideously bad code, but it works on the first example you gave.
VB Code:
Also works for example in post #3 (with the last XXX removed).
__________________
This world is not my home. I'm just passing through. Add yourself to the VBForums Frappr Map!! Last edited by trisuglow; Oct 17th, 2005 at 11:22 AM. |
|
|
|
|
|
#5 |
|
Member
Join Date: Jun 05
Location: Poulsbo, WA
Posts: 60
![]() |
Re: Isolating text strings from a file
Yep, works like a charm. Now I just have to figure a way to work with the inconsistencies of the reporting.
Thanks! John |
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|