retrieve file information?
retrieve file information?
- monahanks
- Posts: 17
- Joined: Wed Mar 30, 2011 9:19 am
Re: retrieve file information?
To retrieve the attributes of a complex variable use the following variable reference syntax.
${variableName:attributeName}
The colon (:) separates the variable from the attribute.
Software Support
Linoma Software
- Support_Julie
- Support Specialist
- Posts: 77
- Joined: Thu Mar 05, 2009 2:49 pm
- Location: Ashland, NE USA
Re: retrieve file information?
- monahanks
- Posts: 17
- Joined: Wed Mar 30, 2011 9:19 am
Re: retrieve file information?
If you so desired, you could Set a Variable to check a condition later.
<project name="Print FileList attribute variables" mainModule="Main" version="1.0">
<module name="Main" logLevel="debug">
<createFileList fileListVariable="fileList" numFilesFoundVariable="fileCount" version="1.0">
<fileset dir="/temp/mltmbr" />
</createFileList>
<forEachLoop itemsVariable="${fileList}" currentItemVariable="thisFile">
<setVariable label="fill trimFileName" name="trimFileName" value="${thisFile:path}" version="1.0" />
<setVariable label="fill mbrName" name="mbrName" value="${thisFile:nameWithoutExtension}" version="1.0" />
<print version="1.0">
<![CDATA[Attribute List
name: ${thisFile:name}
extension: ${thisFile:extension}
last modified date:${thisFile:lastModifiedDate}
size: ${thisFile:size}
path: ${thisFile:path}
nameWithoutExtension: ${thisFile:nameWithoutExtension}
parentFile: ${thisFile:parentFile}
]]>
</print>
</forEachLoop>
</module>
<variable name="libName" value="mylib" />
</project>
Software Support
Linoma Software
- Support_Julie
- Support Specialist
- Posts: 77
- Joined: Thu Mar 05, 2009 2:49 pm
- Location: Ashland, NE USA
Re: retrieve file information?
- monahanks
- Posts: 17
- Joined: Wed Mar 30, 2011 9:19 am
Re: retrieve file information?
Here are the XML lines without a search and replace
- Code: Select all
<print label="write date to file" file="date.csv" append="false" version="1.0">
<![CDATA[${thisFile:lastModifiedDate}]]>
</print>
<readCSV inputFile="date.csv" outputRowSetVariable="data" fieldDelimiter="space" skipFirstRow="false" recordDelimiter="LF" textQualifier="none" version="1.0" />
<setVariable name="date" value="${data[1]}" version="1.0" />
- Support_Duane
- Support Specialist
- Posts: 66
- Joined: Thu Mar 05, 2009 2:49 pm
Who is online
Users browsing this forum: No registered users and 1 guest