Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   XML (http://www.programmingforums.org/forum28.html)
-   -   can anyone create a program that... (http://www.programmingforums.org/showthread.php?t=13624)

joel_garrison Jul 25th, 2007 3:09 PM

can anyone create a program that...
 
Hi,
My Name is Joel Garrison

I was wondering if anyone could create a program that will take file names and create a XMl document, details follow


I need to take the following File names which are always standard
CSD-[prefix]_[Segence#]_[line name].tap

Each one of these files is in a different directory with basicly the same name but without the CSD- in front.

I need to grab every one of these file names in each dir and Xport them into the XML file that looks like the following

Quote:

<?xml version="1.0"?>
<segd21-tape vsn="[output tape#">
<line id="[prefix]_[linename]" seq="[Sequence#]">
<segd-image file="[prefix]_[Segence#]_[line name]/CSD-[prefix]_[Segence#]_[line name].tap"/>
</line>
</segd21-tape>
Quote:

Example
File
(dir) WC1_1_40305250
\
--------> (file name) CSD-WC1_1_40305250.tap
(dir) WC1_2_40305124
\
--------> (file name) CSD-WC1_2_40305124.tap
needs to exported to look like

Quote:

<?xml version="1.0"?>
<segd21-tape vsn="A10000">
<line id="WC1_40305250" seq="1">
<segd-image file="WC1_1_40305250/CSD-WC1_1_40305250.tap"/>
</line>
<line id="WC1_40305124" seq="2">
<segd-image file="WC1_2_40305124/CSD-WC1_2_40305124.tap"/>
</line>
</segd21-tape>
There could be as many as 125-200 Files in the XML file.
Thanks,
Guys

DaWei Jul 25th, 2007 3:58 PM

Your question isn't very clear. Is your problem devising related filenames, or in generating XML (a constrained, textual format)? One can transmogrify filenames with but a mere expenditure of energy.

joel_garrison Jul 25th, 2007 4:02 PM

Quote:

Originally Posted by DaWei (Post 131126)
Your question isn't very clear. Is your problem devising related filenames, or in generating XML (a constrained, textual format)? One can transmogrify filenames with but a mere expenditure of energy.

the issue is in createing the XML file

Forget the photo that I added, it's out of date a wrong. but I need to take the file names and xport them into a xml document. i can create the XML document by hand but that takes ages and was wondering if someone could create a program ( perl/python) that would automate the task for me.

hopefully this clears things up... probley not it doesn't make much since to me either :)

DaWei Jul 25th, 2007 5:08 PM

Quote:

was wondering if someone could create a program ( perl/python) that would automate the task for me.
You might want to consider the Jobs Forum. You don't have to actually offer money there. You will most likely get what you paid for.


All times are GMT -5. The time now is 2:57 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC