StrataFrame Forum
Back
Login
Login
Home
»
.NET Forums
»
General .NET Discussion
»
Parse RTF or Text Control into several lines including spaces
Parse RTF or Text Control into several lines including spaces
Post Reply
Like
2
Parse RTF or Text Control into several lines including spaces
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Michael Reese
Michael Reese
posted 15 Years Ago
ANSWER
HOT
Topic Details
Share Topic
Group: StrataFrame Users
Posts: 235,
Visits: 1.6K
I'm need to parse a text control or Rtf control into several lines. I plan populate an OBX segment for transcriptions. I have the code for building the actual HL7 message. Just need some help on the parsing logic.
Thanks
Michael
Reply
Like
2
Replies
Charles R Hankey
Charles R Hankey
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 524,
Visits: 30K
I must not be asking my questions properly because you aren't answering them and just keep saying the same things over and over again so I will bow out and let someone else take a shot at it.
Good luck.
Reply
Like
2
Trent Taylor
Trent Taylor
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
Michael,
Part of my confusion is why you are working on EDI out of a text box. I really don't know what part you are not getting either based on the comments on this thread so far.
So let me tell you what I generally do when working with EDI. In a very simple sample, the Split is an awesome feature and I will use it. However, when parsing EDI, it is generally best to create a reader. If you are reading out of a file, then I would create a FileStream then a StreamReader off of that file stream. You can also use a StringReader which would look something like this:
string line;
string[] segments;
System.IO.StringReader reader = new System.IO.StringReader(MyTextBox.Text);
line = reader.ReadLine();
while(!string.IsNullOrEmpty(line))
{
//-- Parse the line here. You may want to use a split at this point for segment delimitters (i.e. a pipe [|])
segments = line.Split(new char[] { '|' }, StringSplitOptions.None);
//-- Determine the segment type
switch(segments[0])
{
case "OBX":
{
//-- Place your OBX logic here
} break;
}
//-- Read the next line
line = reader.ReadLine();
}
Reply
Like
2
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
Parse RTF or Text Control into several lines including spaces
Michael Reese
-
15 Years Ago
I am not quite following what you are trying to do. Are you wanting...
Trent L. Taylor
-
15 Years Ago
Are you just looking to parse a textfield (or RTF stored as text) into...
Charles R Hankey
-
15 Years Ago
Thanks guys,
I have a text or RTF. I want to extract the...
Michael Reese
-
15 Years Ago
Well, I have lived in the realm of EDI interfaces for a good long...
Trent L. Taylor
-
15 Years Ago
Ok, thank,
Yeah, My message is generating but I need to...
Michael Reese
-
15 Years Ago
Be aware the .Split() thing has a lot of flexibility.
...
Charles R Hankey
-
15 Years Ago
I need to see the lines and and breaks and spaces between lines. Do...
Michael Reese
-
15 Years Ago
Not sure what you mean by "the lines and breaks and spaces between the...
Charles R Hankey
-
15 Years Ago
Stretching out your sample on my big monitor it seems to be just a...
Charles R Hankey
-
15 Years Ago
Ok,
I need to read the textbox. Parse the contents into...
Michael Reese
-
15 Years Ago
I must not be asking my questions properly because you aren't...
Charles R Hankey
-
15 Years Ago
Michael,
Part of my confusion is why you are working on EDI...
Trent L. Taylor
-
15 Years Ago
Post Reply
Like
2
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search