Click here to Skip to main content
15,896,201 members
Home / Discussions / C#
   

C#

 
QuestionPrinting a bill format Pin
prerana patil3-Sep-13 22:59
prerana patil3-Sep-13 22:59 
AnswerRe: Printing a bill format Pin
OriginalGriff3-Sep-13 23:30
mveOriginalGriff3-Sep-13 23:30 
QuestionDaft question on indenting text. Pin
Septimus Hedgehog3-Sep-13 5:21
Septimus Hedgehog3-Sep-13 5:21 
GeneralRe: Daft question on indenting text. Pin
harold aptroot3-Sep-13 5:36
harold aptroot3-Sep-13 5:36 
AnswerRe: Daft question on indenting text. Pin
Dave Kreskowiak3-Sep-13 5:37
mveDave Kreskowiak3-Sep-13 5:37 
AnswerRe: Daft question on indenting text. Pin
Septimus Hedgehog3-Sep-13 5:58
Septimus Hedgehog3-Sep-13 5:58 
AnswerRe: Daft question on indenting text. Pin
jschell3-Sep-13 12:40
jschell3-Sep-13 12:40 
GeneralRe: Daft question on indenting text. Pin
Septimus Hedgehog3-Sep-13 20:36
Septimus Hedgehog3-Sep-13 20:36 
AnswerRe: Daft question on indenting text. Pin
BillWoodruff3-Sep-13 17:24
professionalBillWoodruff3-Sep-13 17:24 
GeneralRe: Daft question on indenting text. Pin
Septimus Hedgehog3-Sep-13 20:45
Septimus Hedgehog3-Sep-13 20:45 
GeneralRe: Daft question on indenting text. Pin
BillWoodruff3-Sep-13 23:29
professionalBillWoodruff3-Sep-13 23:29 
GeneralRe: Daft question on indenting text. Pin
Septimus Hedgehog4-Sep-13 0:35
Septimus Hedgehog4-Sep-13 0:35 
GeneralRe: Daft question on indenting text. Pin
BillWoodruff4-Sep-13 3:52
professionalBillWoodruff4-Sep-13 3:52 
GeneralRe: Daft question on indenting text. Pin
Septimus Hedgehog4-Sep-13 6:00
Septimus Hedgehog4-Sep-13 6:00 
AnswerRe: Daft question on indenting text. Pin
Bernhard Hiller3-Sep-13 22:40
Bernhard Hiller3-Sep-13 22:40 
GeneralRe: Daft question on indenting text. Pin
Septimus Hedgehog4-Sep-13 0:15
Septimus Hedgehog4-Sep-13 0:15 
QuestionSubstring / Split String help Pin
Member 101198373-Sep-13 5:02
Member 101198373-Sep-13 5:02 
AnswerRe: Substring / Split String help Pin
Dave Kreskowiak3-Sep-13 5:30
mveDave Kreskowiak3-Sep-13 5:30 
GeneralRe: Substring / Split String help Pin
Member 101198373-Sep-13 5:39
Member 101198373-Sep-13 5:39 
GeneralRe: Substring / Split String help Pin
Dave Kreskowiak3-Sep-13 5:47
mveDave Kreskowiak3-Sep-13 5:47 
AnswerRe: Substring / Split String help Pin
BillWoodruff3-Sep-13 17:46
professionalBillWoodruff3-Sep-13 17:46 
I'm going to assume, based on what you describe, that you have no control over the "batch" of "entries" to be parsed here. Is that correct ?

The second issue is: to what extent is there any possible variation in the content of each "entry" you need to parse, and re-format ? As Dave pointed out to you, is it possible that the "name field" in each entry could vary, as in: Robert Smith; Robert T. Smith; Robert Thomas Smith; R. T. Smith III; Robert Smith 3rd. ... and so forth.

The extent to which you can establish the "variation" possible in the entries imho is going to determine the complexity of either:

1. creating a RegEx as Dave suggested.

2. taking your "batch" and transforming it into another "batch" in which you have inserted de-limiters so that you can, then, use string.Split.

I would likely write code to transform the original data (file, stream, whatever) and insert delimiters, simply because I am not expert in RegEx, and the C# code I'd write, imho, might be more maintainable, and re-usable. However, I would not doubt that someone like Dave could write a documented RegEx expression of great internal complexity that would be equally maintainable, and re-usable. So your choice may depend on what you are most expert in using now, and, given a need, for other people in the future to update, maintain, re-use, your code what those people are likely to be expert in.

Now, if the data was in XML format, you might be looking at defining an xsd to handle transformation.

good luck, Bill
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview

AnswerRe: Substring / Split String help Pin
Forbiddenx4-Sep-13 4:59
Forbiddenx4-Sep-13 4:59 
Question"Handle" Pin
Bernhard Hiller3-Sep-13 3:07
Bernhard Hiller3-Sep-13 3:07 
AnswerRe: "Handle" Pin
Dave Kreskowiak3-Sep-13 3:49
mveDave Kreskowiak3-Sep-13 3:49 
GeneralRe: "Handle" Pin
Bernhard Hiller3-Sep-13 21:43
Bernhard Hiller3-Sep-13 21:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.