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
1
Prev
1
2
Jump To Page
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 14 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Users
Posts: 235,
Visits: 1.6K
Ok,
I need to read the textbox. Parse the contents into several lines each in the obx segment above. I will like to have it read the text object and set the line or row length and include carriage returns.
Thanks
Michael
Reply
Like
1
Charles R Hankey
Charles R Hankey
posted 14 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
1
Trent Taylor
Trent Taylor
posted 14 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
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
1
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
1
Prev
1
2
Jump To Page
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search