There are a couple of ways, but I usually just write out the XML in place. Create a DCR and use that as the template for the output. Just replace the data with variables that are filled in from reading the CSV file. That is the most straight-forward way of doing it. If you have replicants, then you need to code those in, but that is not tough. TS is pretty forgiving about the data structure, so if you get it close, you should be good to go.If you have a minimal amount of experience of Perl and about the same in TS, you should have no trouble.Andy
Write a perl script that uses a SAMPLE DCR for the structure. Hard code it in the script. As to your second issue. I cannot understand what you are asking. How many DCRs do you need to create ? It may be better to do a bunch of cutting and pasting.
Thanks for your response. I just want to make sure I understand correctly--- your suggestion is to write a perl script that would take the template dcr as input and in that replace the data "with variables that are filled in from reading the CSV file. " right? or is this in the datacapture.cfg?One more thing...my csv has a directory field which specifies the dir where the dcr created is to placed.so for e.g: if there are 3 records in the csv file and the first and the third have dir3 in the directory field, then under dir3 there will be just one dcr but with the entries of both the first record and the third record, how do I go about this?thanks,vish
Look at Text:arseWords perl module in that parse_line method to read csv files and to populate dct.
Hope helps little
--------------------------------------------------------------------------------I need to create one dcr for each unique directory in the csv, each record in the csv is assigned a directory which does not necessarily have to be unique....there can be two or more records assigned to the same directorythanks,vish
You need to try writing the code based on your understanding of what you need - you've already been given some advice and the name of at least one Perl module.Once you've taken a good effort at doing this - then, if you're still having problems, post again - otherwise it looks like you're attempting to solicit free development work from others, which is generally frowned upon.
My previous post was a response to the question how many dcrs I need to create I forgot to quote the question in my post and being new to the forum could not delete that post and had to repost with the quote again. I appreciate the valuable advice given and am working on my code. The post was NOT MADE WITH ANY INTENTION of "solicitating free development work from others". I apologize if the post made it look that way.
You can edit posts after you make them.But you do see (hopefully) how the phrasing of the posts sounded like you were asking for everyone to give you free code for 'this', and then 'that', and then 'the other thing' ...I wish you the best of luck in achieving your desired results - I still recommend spending time with the manuals and/or Perl books and such - and experimenting as much as time permits you to do so - you'll learn a lot more through some quick trial-and-error coding attempts than you will being handed complete solutions.
hi,I am new to perl and templating and am not sure how to go about creating a perl script that would extract records from a csv file and populate a dct with these records any help is appreciated.thanks,vish