Loop through the excel files in folder and sub folder
hi all
I need to loop through all the excel fies in a folder and its sub folder which contain excel files
actually, my excel files contain a column with sdate and it contain different dates in which has to get the max date my query is
"select * from @[User::filename] where sdate=(select max(sdate) asi from @[User::filename] )"
loop all the excel file in folder and its sub folder
Take a look at the Foreach Loop.
Here is an article about it.
Andy Tauber
Data Architect
The Vancouver Clinic
Website | LinkedIn
This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
"Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.
Similar Messages
-
Bug with workflow that creates a folder and sub folder with the same name.
Hi,
I've found a possible bug in SharePoint 2010 workflows. I only have access to SharePoint 2010 and SharePoint Designer 2010 over my companies intranet, afaik I don't have access to to logs or anything server side so sorry for the any missing information.
I had some problems with a workflow in one list that needed to create some folders and subfolders in a second list. The production version did a lot more so I setup a test area with 1 list and a workflow that only does the folder creation part and have managed
to consistently replicate this problem.
The test list has two columns, [title] and [sub folder title]
The workflow starts by getting the values for [title] and [sub folder title] into variables.
It then creates a folder in the same list with the same name as [title], and then creates a sub folder under this with the name from [sub folder title]
So the resulting structure would be:
Test List:-
List item with fields [title] and [sub folder title]
[folder: title]:-
[folder: sub folder title]
If both folder names are different (e.g Folder1 and Folder2) then it works perfectly fine, if both folder names are the same (regardless of character case, e.g. samefolderName and sameFolderName) then the workflow fails.
As part of the test i made the first action of the workflow to log the message "Workflow Started" to the history list. When the workflow fail there's nothing logged in the history list other than the error: "The workflow could not update the
item, possibly because one or more columns for the item require a different type of information."
Creating a sub folder with the same name as it's parent works fine manually but for some reason a workflow can't seem to do it in one action.
As there's no history list entries before the error it looks like the workflow is just failing to start but if i do something like add an if statement to check if [title] and [sub folder title] are the same, and only create the subfolder when they are not
then it runs fine doing what it's set to.
The function of the workflow in our office was for convenience so were just working without it. Just wanted to post to see if anyone else has come across this/could try to replicate or explain this and see if it's a SharePoint bug or something specific
to our setup.
thanks,
Martinnot sure about the specifics of your workflow, but if you're querying the list for the folders... keep in mind that a list lookup will only ever bring back ONE item... even if there are several items that meet the filter criteria... example: if i search
a list for an item assigned to "john doe", there may be 15 tasks that meet the criteria, and it'll only grab one... this is why SP Designer WARNS you when your list lookup may exhibit this behavior.
Scott Brickey
MCTS, MCPD, MCITP
www.sbrickey.com
Strategic Data Systems - for all your SharePoint needs -
Folder and Sub-Folder Batch load Script
What I'm looking for I'm not ever sure is possible, but what I need is a script that will search for predefined sub-folder names within a specific "root" folder and run a script I have to load those images into a Photoshop document found within the root folder. When loading these images, it will also need to place the images into a specific group within the Photoshop document, depending on the sub-folder that contained them. So images in the sub-folder "A" need to be loaded into the group "A" in the Photoshop document, images in sub-folder "B" into group "B" and so-on. The number and name of images within the sub-folders are, however, random; so this would also need to be accounted for. Additionally, if possible, I would like the script to ask the user to locate this root folder each time before proceeding; otherwise, if not possible, a static folder location can also be used. Thanks for any help!
dgolbergProfile-mismatches as in: When the container document and the image to be placed are of different Color Spaces (different ICC-profiles).
Could you give this a try (on a copy of your files naturally); it places as Smart Objects (depending on your Photoshop > Preferences > General settings), but you could always rasterize after the import or chenge the preference in the Scripts and reset it at the end:
// place png-files from a folder and its contained folders with groups to represent those in jpg-files;
// 2011, use it at your own risk;
#target photoshop
// select folder;
var theFolder = Folder.selectDialog ("select folder");
if (theFolder) {
// get the jpgs;
var theJpgs = getJpgFiles(theFolder);
// iterate through the jpg files;
for (var m = 0; m < theJpgs.length; m++) {
var theDoc = app.open(new File(theJpgs[m]));
// thanks to xbytor;
var theName = theDoc.name.match(/(.*)\.[^\.]+$/)[1];
// place the png-files in groups coresponding to the folders;
placeFolderFiles(theFolder, theDoc, theName)
////// ceck for jpgs //////
function checkJpg (theFile) {
if (theFile.name.match(/\.(jpg)$/i)) {
return true
////// ceck for pngs //////
function checkPng (theFile) {
if (theFile.name.match(/\.(png)$/i)) {
return true
////// place //////
function placeScaleFile (file, xOffset, yOffset, theScale) {
// =======================================================
var idPlc = charIDToTypeID( "Plc " );
var desc5 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
desc5.putPath( idnull, new File( file ) );
var idFTcs = charIDToTypeID( "FTcs" );
var idQCSt = charIDToTypeID( "QCSt" );
var idQcsa = charIDToTypeID( "Qcsa" );
desc5.putEnumerated( idFTcs, idQCSt, idQcsa );
var idOfst = charIDToTypeID( "Ofst" );
var desc6 = new ActionDescriptor();
var idHrzn = charIDToTypeID( "Hrzn" );
var idPxl = charIDToTypeID( "#Pxl" );
desc6.putUnitDouble( idHrzn, idPxl, xOffset );
var idVrtc = charIDToTypeID( "Vrtc" );
var idPxl = charIDToTypeID( "#Pxl" );
desc6.putUnitDouble( idVrtc, idPxl, yOffset );
var idOfst = charIDToTypeID( "Ofst" );
desc5.putObject( idOfst, idOfst, desc6 );
var idWdth = charIDToTypeID( "Wdth" );
var idPrc = charIDToTypeID( "#Prc" );
desc5.putUnitDouble( idWdth, idPrc, theScale );
var idHght = charIDToTypeID( "Hght" );
var idPrc = charIDToTypeID( "#Prc" );
desc5.putUnitDouble( idHght, idPrc, theScale );
var idLnkd = charIDToTypeID( "Lnkd" );
desc5.putBoolean( idLnkd, true );
executeAction( idPlc, desc5, DialogModes.NO );
return app.activeDocument.activeLayer;
////// place images in folder and contained folders //////
function placeFolderFiles (theFolder, theContainer, theName) {
var theContent = theFolder.getFiles();
for (var n = theContent.length - 1; n >= 0; n--) {
var theObject = theContent[n];
if (theObject.constructor.name == "Folder") {
var aFolder = theContainer.layerSets.add();
aFolder.name = Folder(theContent[n]).name;
placeFolderFiles(theObject, aFolder, theName)
if (checkPng(theObject) == true && theObject.name.match(theName)) {
var theLayer = placeScaleFile(theObject, 0, 0, 100);
theLayer.name = File(theObject).name;
theLayer.move(theContainer, ElementPlacement.PLACEATBEGINNING)
////// place images in folder and contained folders //////
function getJpgFiles (theFolder) {
if (!theArray) {var theArray = new Array};
var theContent = theFolder.getFiles();
for (var n = theContent.length - 1; n >= 0; n--) {
var theObject = theContent[n];
if (theObject.constructor.name == "Folder") {
theArray = theArray.concat(getJpgFiles(theObject))
if (checkJpg(theObject) == true) {
theArray.push(theObject)
return theArray -
Read All files in folder and sub folder
Hi,
i can read files in a folder,but not in a sub folders.can any one give me idea to read all files in the folder and its sub folder.
DeepanHi
This code may help you
Bliz
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;
public class CountFiles {
* @param args
* @throws IOException
* Count files in <path> and all its subDirs
public static String path = "c:";
public static String src1 = "";
public static FileChannel channel;
public static int numF;
public static int numD;
public static void main(String[] args) throws IOException {
countFiles(path);
System.out.println("Number of files :\t"+numF);
System.out.println("Number of dirs :\t"+numD);
public static void countFiles(String strPath) throws IOException
File src = new File(strPath);
if (src.isDirectory())
numD++;
String list[] = src.list();
try {
for (int i = 0; i < list.length; i++)
src1 = src.getAbsolutePath() + "\\" + list;
File file = new File(src1);
try {
channel = new RandomAccessFile(file, "r").getChannel();
}catch(java.io.FileNotFoundException e){}
countFiles(src1);
}catch(java.lang.NullPointerException e){}
else
numF++; -
Automating Group, Sub Group, Folder and Sub Folder Creation
I am relatively new as an administrator, and this may be a simple question.
I need to publish similar groups and folders for 30 instances. I am able to complete this through the CMS functionality, but I was wondering if there was some form of command line input or SQL statement I could use to add them instead. Automation of this process would provide a great time savings, so I am wondering if such a command line/batch file/SQL statement exist. My instance of Business Objects is run with A CMS attached to an Oracle database (if the SQL statement proves to be the answer).
Thanks in advance for any assistance that can be provided.There is no simple command line utility to do this. This is possible via the Enterprise SDK though ([here|http://devlibrary.businessobjects.com/BusinessObjectsXIR2/en/devsuite.htm])
-
Automator - Loop through a text file and process data through a 3rd party software
Just stumbled on Automator the other day (I am a mac n00b) and would like to automate the processing of a text file, line-by-line, using a third party tool. I would like Automator to loop through the text file one line at a time, copy the string and keep as a variable. Next, place the variable data (copied string) into the text field of the 3rd party software for processing. Once the processing is complete, I would like Automator to fetch the next line/string for processing. I see items like "copy from clipboard" and "variables" within the menu but I am not finding much documentation on how to utilizle this tool. Just hear how potentially powerful it is.
The 3rd party software is not a brand name, just something made for me to process text. I may have to use mouse clicks or tabs + [return] to navigate with Automator. A term I heard on Bn Walldie's itunes video series was "scriptable software" for which I don't think this 3rd party app would be.
Kind regards,
jwGood news and bad news...
The good news is that it should be entirely possible to automate your workflow.
The bad news is that it will be a nightmare to implement via Automator, if it's even possible.
Automator is, essentially a pretty interface on top of AppleScript/Apple Events, and with the pretty interface comes a certain stranglehold on features. Knowing how to boil rice might make you a cook, but understanding flavor profiles and ingredient combinations can make you a chef, and it's the same with AppleScript and Automator. Automator's good at getting you from points A to B but if there are any bumps in the road (e.g. the application you're using isn't scriptable) then it falls apart.
What I'm getting at is that your requirements are pretty simple to implement in AppleScript because you can get 'under the hood' and do exactly what you want, as opposed to Automator's restricted interface.
The tricky part is that if no one else can see this app it's going to be hard to tell you what to do.
I can give you the basics on reading a file and iterating through the lines of text in it, and I can show you how to 'type' text in any given application, but it may be up to you to put the pieces together.
Here's one way of reading a file and working through each line of text:
-- ask the user for a file:
set theFile to (choose file)
-- read the file contents:
set theFileContents to (read file theFile)
-- break out the lines/paragraphs of text:
set theLines to paragraphs of theFileContents
-- now iterate through those lines, one by one:
repeat with eachLine in theLines
-- code to perform for eachLine goes here
end repeat
Once you have a line of text (eachLine in the above example) you can 'type' that into another application via something like:
tell application "AppName" to activate
tell application "System Events"
tell process "AppName"
keystroke eachLine
end tell
end tell
Here the AppleScript is activating the application and using System Events to emulate typing the contents of the eachLine variable into the process. Put this inside your repeat loop and you're almost there. -
Excel Files become "Broken" and cannot be opened
Our environment is as follows:
SharePoint 2013 server, web application running in 2010 mode. Our users are primarily on thin clients in a 64-bit Citrix environment running Office 2013 applications. We use a redirected desktop/my documents on a network drive so that users will
have their documents and settings on any computer they log into.
The issue we've run into is that sometimes one of the Excel files becomes "broken" and will no longer open. This seems to be related to when a user has the file open for long periods of time and loses connectivity or if the user's Excel /
session crashes. When the file becomes broken, the symptoms are:
Open document from SharePoint and Excel splash screen reads:
1. Starting...
2. Contacting the Server For Information. (This message lasts ~2 min)
Then an error message in Excel states:
"Microsoft Excel is waiting for another application to complete an OLE action."
OK
"Could not open 'https://sharepointurl/site/subsite/documentlibrary/document name.xlsx'."
OK
Microsoft Excel cannot access the file
'SameFilePathAsAbove'. There are several possible reasons:
The file name or path does not exist.
The file is being used by another program.
The workbook you are trying to save has the same name as a currently open workbook.
OK
Empty workbook
We've had problems determining "who" broke it, but the result is the same - nobody is able to open it, whether using Excel2013, Excel2010, or the Excel Services thru the SharePoint "view in browser" option.
Our terminal servers reboot nightly, we've tried rebooting the 2 SharePoint application servers and the SharePoint SQL server to no avail. It seems like the file is stuck waiting for itself. In some cases, we've found that older versions of the
file can be restored (generally a few versions back) but when versioning is not enabled then that possibility is out.
We cannot seem to resolve where the issue lies at it's core or how to resolve it. This happens much more frequently for the documents that users keep open for long periods of time making modifications to them, but we suspect that's because they are
just more likely to have a SharePoint document open if their computer or Excel client crashes.They don't want us (the dealers) to edit the spreadsheet, but they do want us to read it. It's their pricelist, they wouldn't sell a lot of equipment if we couldn't see how much it costs! The point is that Numbers won't even open a spreadsheet that is edit protected, not read protected. This is a major issue, it should at the very least tell me I can open or import the sheet as a read only.
Excel will always open the spreadsheet, it just can't make changes to it.
For right now, when I need to get information from the pricelist in Excel, I have to copy and paste the info from the edit protected page to another blank sheet. This is a royal PITA because the Excel pricelist has 50 plus pages. I have been officially told to do that by my manufacturer. But they won't give anyone the password to unprotect the edit function of the sheet. Go figure. -
Can I import an entire folder and sub-folders at once?
I am fairly new to LR and have TONS of files in a main Photo folder on Vista. Some of these files have duplicate names, some were taken with very early gen digital camera as well as newer files with my 40D. But importing each folder and sub folder 1 at a time is going to take a million years. Here is basically what I want to do.
1) Import ALL pics (probably about 6-8 thousand) at once
2) Go through these photos and tag them as well as get rid of the obviously crappy pics that i will never do anything with, kill the dupes
3) Meta tag as many as i can
4) export to a new foler
All files are jpg. Nice memorial day project eh?I would make some suggestions to your proposed workflow.
Instead of "3) Meta tag as many as i can", I would say assign keywords and captions on all of your photos. Keywords and captions are a very powerful way of organizing, and when well done, they make finding your photos extremely easy. I understand that this takes time and effort, but you will find that the time and effort you put into this pays off well.
If you leave some photos without keywords and captions, how will you find them? I know how ... you will search for 30 minutes and probably say some four-letter words in the process.
Instead of "4) export to a new foler[sic]", don't bother exporting as a regular part of your workflow. Just don't do it! Only export when you need the photos outside of Lightroom, such as for e-mail or uploading or printing at a commercial printer. Otherwise, there is no need for you to take up the disk space with thousands of exported .jpgs. -
Hi,
I'm very new to Powershell but through the help of this forum and the help on the internet I have scraped together a script that will loop through the disks of a set of servers listed in a text document, and give the capacity statistics in html
format.
I have two questions. I've tried modifying this to also loop though the individual folders on each disk and give the amount of space used to no avail. does any one have any suggestions?
Secondly, how do I get this to append? all I want to do is set up a scheduled task that runs this report daily. I know I will need to add a date column, but I just want the data to append to the previous set of results.
Thanks for any advice in advance.
# Continue even if there are errors
$ErrorActionPreference = "Continue";
# Set your warning and critical thresholds
$percentWarning = 100;
$percentCritcal = 15;
# REPORT PROPERTIES
# Path to the report
$reportPath = "C:\";
# Report name
$reportName = "DiskSpaceReport_$(get-date -format ddMMyyyy).html";
# Path and Report name together
$diskReport = $reportPath + $reportName
#Set colors for table cell backgrounds
$redColor = "#FF0000"
$orangeColor = "#FBB917"
$whiteColor = "#FFFFFF"
# Count if any computers have low disk space. Do not send report if less than 1.
$i = 0;
# Get computer list to check disk space
$computers = Get-Content "C:\serverlist.txt";
$datetime = Get-Date -Format "dd-MM-yyyy_HHmmss";
# Create and write HTML Header of report
$titleDate = get-date -uformat "%d-%m-%Y - %A"
$header = "
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<title>DiskSpace Report</title>
<STYLE TYPE='text/css'>
<!--
td {
font-family: Calibri;
font-size: 12px;
border-top: 1px solid #999999;
border-right: 1px solid #999999;
border-bottom: 1px solid #999999;
border-left: 1px solid #999999;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
body {
margin-left: 5px;
margin-top: 5px;
margin-right: 0px;
margin-bottom: 10px;
table {
border: thin solid #000000;
-->
</style>
</head>
<body>
<table width='100%'>
<tr bgcolor='#0B6121'>
<td colspan='7' height='30' align='center'>
<font face='calibri' color='#E0F8F7' size='4'><strong>Daily Disk Utilization Report for $titledate</strong></font>
</td>
</tr>
</table>
Add-Content $diskReport $header
# Create and write Table header for report
$tableHeader = "
<table width='100%'><tbody>
<tr bgcolor=#E0F8F7>
<td width='10%' align='center'>Server</td>
<td width='5%' align='center'>Drive</td>
<td width='15%' align='center'>Drive Label</td>
<td width='10%' align='center'>Total Capacity(GB)</td>
<td width='10%' align='center'>Used Capacity(GB)</td>
<td width='10%' align='center'>Free Space(GB)</td>
<td width='5%' align='center'>Freespace %</td>
<td width='5%' align='center'>RAM %</td>
<td width='5%' align='center'>CPU %</td>
</tr>
Add-Content $diskReport $tableHeader
# Start processing disk space
foreach($computer in $computers)
$disks = Get-WmiObject -ComputerName $computer -Class Win32_LogicalDisk -Filter #"DriveType = 3"
$computer = $computer.toupper()
foreach($disk in $disks)
$deviceID = $disk.DeviceID;
$volName = $disk.VolumeName;
[float]$size = $disk.Size;
[float]$freespace = $disk.FreeSpace;
$percentFree = [Math]::Round(($freespace / $size) * 100);
$sizeGB = [Math]::Round($size / 1073741824, 2);
$freeSpaceGB = [Math]::Round($freespace / 1073741824, 2);
$usedSpaceGB = $sizeGB - $freeSpaceGB;
$color = $whiteColor;
# Start processing RAM
$RAM = Get-WmiObject -ComputerName $computer -Class Win32_OperatingSystem
$RAMtotal = $RAM.TotalVisibleMemorySize;
$RAMAvail = $RAM.FreePhysicalMemory;
$RAMpercent = [Math]::Round(($RAMavail / $RAMTotal) * 100);
# Set background color to Orange if just a warning
if($percentFree -lt $percentWarning)
$color = $orangeColor
# Set background color to Orange if space is Critical
if($percentFree -lt $percentCritcal)
$color = $redColor
# Create table data rows
$dataRow = "
<tr>
<td width='10%'>$computer</td>
<td width='5%' align='center'>$deviceID</td>
<td width='10%' >$volName</td>
<td width='10%' align='center'>$sizeGB</td>
<td width='10%' align='center'>$usedSpaceGB</td>
<td width='10%' align='center'>$freeSpaceGB</td>
<td width='5%' bgcolor=`'$color`' align='center'>$percentFree</td>
<td width='5%' align='center'>$RAMpercent</td>
<td width='5%' align='center'>$CPUpercent</td>
</tr>
Add-Content $diskReport $dataRow;
Write-Host -ForegroundColor DarkYellow "$computer $deviceID percentage free space = $percentFree";
$i++
# Create table at end of report showing legend of colors for the critical and warning
$tableDescription = "
</table><br><table width='20%'>
<tr bgcolor='White'>
<td width='10%' align='center' bgcolor='#FBB917'>No Warning</td>
<td width='10%' align='center' bgcolor='#FF0000'>Critical less than 10% free space</td>
</tr>
Add-Content $diskReport $tableDescription
Add-Content $diskReport "</body></html>"The only easy way to create a report like this that accumulates is to design it so the data is output to a CSV file or a database. YOu can then generate the HTML from the persist6ed data.
If you store as XML you can use XSLT (transform) to convert to an HTML report.
I also recommend uing Excel as an HTML report generator. It is much easier and more flexible. PowerShell is not intended to do what you want without designing a whole custom reporting system.
Use the right tool for the right task.
Just because you own a hammer does not mean that the solution to every problem includes a nail.
¯\_(ツ)_/¯ -
Loop through a csv file and return the number of rows in it?
What would be simplest way to loop through a csv file and
return the number of rows in it?
<cffile action="read" file="#filename#" output="#csvstr#"
>
<LOOP THROUGH AND COUNT ROWS>ListLen(). Use chr(13) as your delimiter
-
How to loop through Multiple Excel sheets and load them into a SQL Table?
Hi ,
I am having 1 excel sheet with 3 worksheet.
I have configured using For each loop container and ADO.net rowset enumerator.
Every thing is fine, but after running my package I am getting below error
[Excel Source [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. There may
be error messages posted before this with more information on why the AcquireConnection method call failed.
Warning: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (5) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified
in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
[Connection manager "Excel Connection Manager"] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft Access Database Engine" Hresult: 0x80004005 Description: "The Microsoft Access database engine cannot open or write to the file ''. It is already opened exclusively by
another user, or you need permission to view and write its data.".
Pleas suggest me the correct way of solving above issues.
Thanks in advance :)
regards,
Vipin jha
Thankx & regards, Vipin jha MCPHi ,
Please refer the below link for Looping multiple worksheet in a single SQL Table.
http://www.singhvikash.in/2012/11/ssis-how-to-loop-through-multiple-excel.html
Note:-If you using excel 2010 then you have to use EXCEL 12.0 .
Above link explaining step by step of Looping multiple worksheet in a single SQL Table.
regards,
Vipin jha
Thankx & regards, Vipin jha MCP -
Upload the excel file in oracle db through oracle forms
Hi all,
I want to upload the excel file in oracle db through oracle forms...I am new to oracle forms .
I have searched a lot but not getting exact solution
Is there anyone who will help me out with this .....
Any help will be appriciatedI'm trying to move data from excel into an Oracle forms field. This involves coping 2 columns of data cells in excel and pasting it into an Oracle forms field. I can get the date pasted into the Oracle forms field but there is a invisible character that separates the 2 columns of data coming from Excel. I do not know what this character is but it is causing the error 'Line 1 is invalid. Check forms'.
Any ideas how to get pass this?
Thank you -
Script code sample for looping through the records from xml data file in formCalc script
Hi
I have a xml data file which contains a sequence of repeating applicant data like given below
US
II
CEO
Mr
111111111
0000000111
GuarantorA
111
IN
11111
WILLIAMS1
R3
KENNETH1
City1GU
PA
1934-03-14
[email protected]
GU
R
113 Lazlo LaneCA
Suite 3500CA
OaklandCA
TX
11345
AL
I want to assign a textfield with a value based on the value of coap_flag.
So i need to loop through all the record and check the value of coap_flag and then assign the textfield a value based on that.
I am new to Adobe livecycle...Please help me how it can be done.
I have developed something like this
foreach Item in ($record.applicant[*].coap_flag) do
test.value=Item
if(test.value=="MA")then
concat($record.applicant.first_name,$record.applicant.middle_name)endif
endforUsing the data you posted in the forum, I copied it a couple of times to give multiple records and used this code to extract the different values that you wanted. I had to wrap it in a <root> node that I called root (to make it valid XML). In my case I wrote the extracted values to a field, but in your case you can do whatever you want with them. Note that this was done in javascript:<br /><br />var currentElement;<br />var obj;<br /><br />//Get the nodes below the root node in the dataDom<br />obj = xfa.datasets.data.root.nodes;<br /><br />//Set an initial value for the textField<br />TextField1.rawValue = "The values of the coap_flag are: ";<br /><br />//Loop through the nodes in the obj set <br />for (i=0; i< obj.length ; i++){<br /> //set the currentElement to the 1st child node<br /> currentElement = obj.item(i);<br /> //Check to see if it is an applicant node<br /> if (currentElement.name == "applicant"){<br /> //It is an applican, now find the coap_flag node value and write it to the text field<br /> TextField1.rawValue += "\n" + xfa.resolveNode("xfa.datasets.data.root.applicant[" + i + "]").coap_flag.value;<br /> }<br />}
-
Loop through the records from xml data file in formCalc script
Hi
I have a xml data file which contains a sequence of repeating applicant data like given below
US
II
CEO
Mr
111111111
0000000111
GuarantorA
111
IN
11111
WILLIAMS1
R3
KENNETH1
City1GU
PA
1934-03-14
[email protected]
GU
R
113 Lazlo LaneCA
Suite 3500CA
OaklandCA
TX
11345
AL
I want to assign a textfield with a value based on the value of coap_flag.
So i need to loop through all the record and check the value of coap_flag and then assign the textfield a value based on that.
I am new to Adobe livecycle...Please help me how it can be done.
I have developed something like this
foreach Item in ($record.applicant[*].coap_flag) do
test.value=Item
if(test.value=="MA")then
concat($record.applicant.first_name,$record.applicant.middle_name)endif
endforUsing the data you posted in the forum, I copied it a couple of times to give multiple records and used this code to extract the different values that you wanted. I had to wrap it in a <root> node that I called root (to make it valid XML). In my case I wrote the extracted values to a field, but in your case you can do whatever you want with them. Note that this was done in javascript:<br /><br />var currentElement;<br />var obj;<br /><br />//Get the nodes below the root node in the dataDom<br />obj = xfa.datasets.data.root.nodes;<br /><br />//Set an initial value for the textField<br />TextField1.rawValue = "The values of the coap_flag are: ";<br /><br />//Loop through the nodes in the obj set <br />for (i=0; i< obj.length ; i++){<br /> //set the currentElement to the 1st child node<br /> currentElement = obj.item(i);<br /> //Check to see if it is an applicant node<br /> if (currentElement.name == "applicant"){<br /> //It is an applican, now find the coap_flag node value and write it to the text field<br /> TextField1.rawValue += "\n" + xfa.resolveNode("xfa.datasets.data.root.applicant[" + i + "]").coap_flag.value;<br /> }<br />}
-
I saved an Excel file yesterday afternoon, and when I opened it today, all the formatting was lost.
See:
*[[/questions/894442]] OWA 2010/Firefox 8 and ASHX Attachments
*[[/questions/895024]]
Maybe you are looking for
-
How to Capture the event when minimized button is clicked of a JFrame?
Hi All, In my SWING application, I want to do something when the minimized button is clicked. But not able to understand how to do that. My basic requirement is like that, if I minimize the JFrame, it should be minimized to system tray with an icon.
-
Urgent: Issue while displaying the PDF Reports Using XDO Common region
Hi all, In our product code we are trying to display the PDF Reports, using the xdo common region. Previously we were writing the pdf reports direclty onto the response direclty. This displays the report onto the browser but if navigate throw browser
-
How Do I Decide Which MacBook is Right For Me?
I am currently a high school senior and I have always had my heart set on a MacBook and my oldest sister has offered to buy me one for my graduation present. My only problem is I am not too sure which one is the best for me. I know MacBooks in genera
-
Error opening the form in Reader 7
I have designed a form in LiveCycle designer 8. The form has a regular Submit button which posts data a URL (a java servlet) using HTTP URL encoded. The form opens and works as expected in versions 8 and 9. However, when I open the form in 7, I get t
-
How to mapped CO2 in the process
Dear Master, In the Beer manufacturing process Co2 is produced ( it is taken as byproduct ) & that co2 is used for filling cylinder in Keg.But the amount of CO2 produced is less so it is procured from other vendor to fulfill the requirement. Please e