Writing a generic file formatter?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jason_Latta
Posted On:   Wednesday, February 12, 2003 06:31 AM

Looking for a way to develop a generic FileFormatter utility class that will provide a mechanism to format a file depending on the desired outcome. For instance, the file may contain a header and/or footer, it may need to be right or left justified, etc. Also, I will need to apply patterns to the data contained within the files so I am leaning towards using regular expressions since some of the column information may need to be padded with certain number or characters. I realize that what I am asking is very abstract, but am looking for direction in the most efficient way to capture this information about the file formatting (i.e. should it be specified in a properties file, should the info be encapsulated in a FileFormat object wrapper class, etc.). Because th   More>>

Looking for a way to develop a generic FileFormatter utility class that will provide a mechanism to format a file depending on the desired outcome. For instance, the file may contain a header and/or footer, it may need to be right or left justified, etc. Also, I will need to apply patterns to the data contained within the files so I am leaning towards using regular expressions since some of the column information may need to be padded with certain number or characters. I realize that what I am asking is very abstract, but am looking for direction in the most efficient way to capture this information about the file formatting (i.e. should it be specified in a properties file, should the info be encapsulated in a FileFormat object wrapper class, etc.). Because this class needs to be very flexible and able to change the format quite easily, I am really looking for a pattern and if possible sample code snippets.

NOTE: The class would need to be able to adequately express the contents if the pattern change for any given line. In other words, there may exist multiple patterns for a given file depending on the row encountered.

Thanks in advance.

   <<Less

Re: Writing a generic file formatter?

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, February 12, 2003 06:52 AM

Sounds like a job for XML and XSL.

About | Sitemap | Contact