View Single Post
  #2 (permalink)  
Old 02-14-2008, 07:23 AM
fahlyn's Avatar   
fahlyn fahlyn is offline
Learning Programmer
 
Join Date: Nov 2007
Age: 25
Posts: 35
Credits: 0
Rep Power: 4
fahlyn is on a distinguished road
Send a message via ICQ to fahlyn Send a message via AIM to fahlyn Send a message via MSN to fahlyn Send a message via Yahoo to fahlyn
Default

I'm assuming that you want this to be dynamic enough to be able to handle "any" pattern fed into this template generator without having to select delimiters or anything like that. I think, in order to do that, you'll first need to define the different types of characters that a pattern could contain. You've got alphanumeric characters, special characters (!,@,#,$,%...), and other special characters (\n,\t,\r,\s...). I'm not sure what the best way would be to do this, but just off the top of my head, it seems like you need to go through record by record and keep track of the position and character type of each character in the record. Then, as you go through each row in your file compare the positions and character types to the previously tracked positions and character types.

Anyway, I've never had the opportunity to use them, but Perl's formats might be something that would help in doing something like this.
__________________
Visit My Google Group Here:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote