Using Wildcards in Mapping Script
Hi everybody, im new in FDM and i have some doubts about mapping scripts.
I have to recreate this Hyperion Translation Rule into FDM:
ACC_SAP tm_sap Reverse Sign UD4
N21099Z300 {NULL} FALSE CD1
D31199Z000 {NULL} FALSE CD1
????99 * FALSE CD
ACC_SAP is the source account
TM_SAP will be loaded into UD5 (as look up)
How could i manage with a like mapping?
I guess using a script but im not sure how to use wildcards within scripts, is it possible?
Another related question, in a explicit mapping, how can i manage with NULL values if i want to assign them [None] value, do i have to put NULL in th source field?
BR and thanks
Thanks KellyDGreen. With the exampl shown is as you say but what if tm_sap has wildcards?
F.i
ACC_SAP TM_SAP TARGET_CUSTOM4
999? 123? 198276
Suppose that TM_SAP has been stored in UD5. Source dimensions are different from target dimension so i have to do it via script, dont I?
BR
Francisco
Similar Messages
-
FDM Mapping script produces result #script
Hello,
I am trying to use the following mapping script and instead of getting the result defined in the script it is producing the result #script. It is as if it is taking that as the target rather than processing the script. Has anyone else seen this behavior in FDM?
strTrgAcct = varValues(14)
Select Case strTrgAcct
Case "100900","100925","101310","201690","201700"
Result = "010"
Case "104200", "104300", "104500", "104700", "104800", "104900", _
"105000", "105200", "105300", "105450"
Result = "060"
Case "107300"
Result = "210"
Case Else
Result = "[None]"
End SelectHello,
If you are sure that all the columns are filled out correctly and there is nothing in your user error log; I would then suggest you create an SR to have an engineer review it.
Thank you, -
OWB 904 doesn't use DB Links in mapping scripts
I'm having trouble deploying mappings because they don't use the generated DB Links in the mapping scripts.
Normally when deploying a mapping I get this warning that certainly is correct since it can't find the source table:
VLD-2771: System privileges may not allow extraction from source ZIPCODE.
Extract from the mapping script:
CURSOR "ZIPCODE_c" IS
SELECT
"ZIPCODE_DWH"."ZIPCODE" "ZIPCODE",
"ZIPCODE_DWH"."CITY" "CITY",
ROWNUM "ROWNUM_ALIAS$$$"
FROM "AXAPTA"."ZIPCODE" "ZIPCODE_DWH" ;
Only when explicitly typing the name of the DB link in the configure options of the mapping will it work. But when I do this I get the following warning:
VLD-1124: Schema and/or Database link physical configuration parameters should not be set for ZIPCODE.
The version of the code that works:
CURSOR "ZIPCODE_c" IS
SELECT
/*+ NO_MERGE */
"ZIPCODE_dwh.business8123"."ZIPCODE" "ZIPCODE",
"ZIPCODE_dwh.business8123"."CITY" "CITY",
ROWNUM "ROWNUM_ALIAS$$$"
FROM "ZIPCODE"@"dwh.business.auc.dk@dwh" "ZIPCODE_dwh.business8123" ;
Shouldn't the mapping script use the DB Link normally or is there an option I have missed? I see in the Reviewers Guide that the target user is granted access to the source (through Public) but won't this only work if both source and target is in the same database?
Regards
BentHi guys,
I am facing a strange problem. The code generated for my mapping has NOT used the dblinks. My OWB version is 10.1.0.4
This is my problem in brief.
I have installed OWB newly and started to do a sample task. I created a very simple one to one table population mapping from source to the target schema. Both are in the same database.
When i generated the code for the mapping, it gave a warning 'VLD-2771: System privileges may not allow extraction from source EMP'.
When i checked the code which was generated, i couldnot see any dblinks associated with my source table( which seems strange)
CURSOR "INGRP_c" IS
SELECT
"EMP_SRC_TRG_CONN"."EMPNO" "EMPNO",
"EMP_SRC_TRG_CONN"."ENAME" "ENAME",
"EMP_SRC_TRG_CONN"."JOB" "JOB",
"EMP_SRC_TRG_CONN"."MGR" "MGR",
"EMP_SRC_TRG_CONN"."HIREDATE" "HIREDATE",
"EMP_SRC_TRG_CONN"."SAL" "SAL",
"EMP_SRC_TRG_CONN"."COMM" "COMM",
"DEPT_SRC_TRG_CONN"."DEPTNO" "DEPTNO_1",
"DEPT_SRC_TRG_CONN"."DNAME" "DNAME",
"EMP_SRC_TRG_CONN"."DEPTNO" "DEPTNO",
"DEPT_SRC_TRG_CONN"."LOC" "LOC"
FROM "SCOTT"."EMP" "EMP_SRC_TRG_CONN" ;
In brief this is the process i have done.
Source schema : SCOTT & Target schema : TRG_SCHEMA
1) I have created source (for SCOTT) and target(for TRG_SCHEMA) modules.
2) I have also created DBLinks, Locations and Connector from source to the target locations.
3) I registered both the source location and target locations.
4) Validated, Generated and Deployed the Connector from source to the target.
I was unable to trace the error. Did i miss anything in the configuration? or during the installation of OWB.
Though it is a very old post, i hope someone can help me out here.
Thanks in Advance,
Sri -
Is it possible to use wildcards to match cell contents in an if statement?
I need to return a ID along with some other information on a page by page basis, so that the information comes out linked by position. I use a couple of loops and if statements to navigate through the document. I am able to use exact matches of cell contents which is fine when the contents doesn't vary. But the IDs, though they have a similar pattern, are all different. In a menu driven search, I am able to find what I need with '150^9^9^9^9^9-^9^9^9' But when I try putting this (or any number of [0-9], *, ? combinations) it fails. Is it possible to use wildcards? The symbol used for the match (==) makes me suspect that it is not possible and that only literal, exact matches will work. But I wanted to check with the experts before giving up.
Thanks
pcbazThanks for the input. You're right, a GREP search is much more efficient. But what I'm trying to do and the circumstances here don't allow me, I think, to go that route. I am trying to generate a list of values coming from several textframes on a single page and have them come out so that I can tell which values belong together.
I'm using an inherited document with masters that were created 'manually'; the index numbering for textframes and tables is random. I navigate through the pages, looping through textframe indices asking ' does this textframe exist?' If so, I ask if it is a table -- if no, it is a simple textframe and I ask about the ID, if yes, I ask if the contents of cell (0,0) (invariant position and contents) are equal to the table I want.. I am sending the ID and other pieces of information from the table to one row of a new table on a new page. So the ID and other information from a single page are linked by being in the same row.
I know this a little 'off-normal' -- I'm using the search to navigate through the document and find things by location the way you do with a spreadsheet. I have devised a work-around that helps me get around the fact that the ID is not invariant. I create a list of the (exact) IDs from another document, equating them to a variable ('a'). I then loop through the list of IDs and ask if the contents of the textframe is equal to 'a'..This works o.k, unless there happens to be an extra space, a different kind of hyphen, etc. It would be so much easier if I could use the wildcards that work in a menu-driven text or GREP search in script just to ask about the contents of the textframe.
Thanks again
pcbaz (Peter BIerly)
P.S. we have since rewritten the masters so this problem will not exist in the future -- we now know exactly which textframe and/or table indices to refer to to get any particular bits of information and don't need to ask questions about the contents. -
SSIS and Secured FTP Commands to GET a Remote File using wildcards
So my biggest caveat here is dealing with wildcards! For the life of me I cannot find any good examples of SSIS and scripting that uses FTP wildcards to GET certain Files. In a nutshell, here's what I need to do...
Query a SQL Server Database which has a parsed File Name, the first 50 characters of the file name.
The Query "Result Set" is put into an Object Variable User::SQLServerFileList
I then utilize a "Foreach Loop Container" which reads the User::SQLServerFileList and puts it into Variable User::SQLServerFileNm...which is again the first 50 characters of the File Name
Within the "Foreach Loop Container", I then utilize an "Expression Task" which builds a variable User::RemoteFileLookup which is a concatenation of the User::RemoteFolderPath + User::SQLServerFileNm + the wildcard *(Variable
User::RemoteWildCard)
I then try and utilize a "FTP Task" to use that concatenated Variable to go and GET the Filename but every time I try, it does not like what I'm sending via the "FTP Task"
Error: 0x0 at TF Secure FTP Task, ExecuteTask Failed:: Illegal characters in path.
I realize I might have to do something like this via C#.
My biggest challenge is providing the GET Command via the Remote FTP Site with a parsed Filename and utilizing a wildcard.
mc7i1231_20140227_050114_27_05_02_09*.999
And the Filename that exists on the FTP Server is...
mc7i1231_20140227_050114_27_05_02_09_x12_a43419452ca844a9b8a00f61e655dca3.x12-20140303180032.999
Can any gurus out there PLEASE help me out???
Thanks in advance for your review and am hopeful for a reply.
PSULionRPHi PSULionRP,
According to the document
FTP Task, we can read that:
The FTP task supports the ? and * wildcard characters in paths. This lets the task access multiple files. However, you can use wildcard characters only in the part of the path that specifies the file name. For example, C:\MyDirectory\*.txt is a valid
path, but C:\*\MyText.txt is not.
So, when you use expression tobuild the variable RemoteFolderPath, make sure the evaluated value of the expression conforms to the above rule.
Regards,
Mike Yin
TechNet Community Support -
Hi All,
is there a possibility to swith the sign in a mapping script.
So my target for the like mapping = #Script and my script says
If VarValues(9) < 0 then
Result = "143100"
Else
Result = "222200"
End if
Is there a possibility to make the value multiplied by -1 for the first option?
My other solution is to use 2 separate mappings but i would prefer to use only 1.
Thanks in advance,
MarcAlso you will have to create a logic account to duplicate the source value for the data line in question or you will never hit the second mapping
-
Using FDM Import Action script to import data from ERPI table "tdataseg_t"
Hi Experts
I have extracted data from EBS using ERPI and loaded into the intermediate table "tdataseg_t"
I am trying to use Import Action script within FDM to extract data from "tdataseg_t" table (where ERPI extract data is stored) as i could not use the normal import script.
Requirement : I have to restrict the custom 2 dimension based on Account dimension.
Dim Account
Account = ???? ( i am struck here)
If Account = 1000 to 5000 Then
Custom2 = Right( product , 5)
End If
but , I could not find the exact syntax to call the Account dimension from the "tdataseg_t" table.
Please Advise
Thanks
Sak
Edited by: user12292415 on Feb 26, 2012 1:19 AMHello,
Importing data via a manual script defeats the purpose of ERPi. As it will not provide you an audit trail, drill-through/drill-back, etc.
Your best bet is to use the default settings by the software. Just because it returns more records than you want is not a bad thing. You can conditionally change/alter the information either in an EventScript inside of FDM or by mapping the un-needed information to IGNORE.
Thank you, -
Hello,
I need to do Market Basket Analysis for my data, and have a working R script when using it in R Studio. I need to transfer that R script to Azure ML Studio. I read in another posting that the arules package is pre-installed and that I need
to use the Execute R Script module since there is not other built-in module/function that does anything similar to Market Basket. I went ahead and copy-paste my R script into the module with some slight modifications in terms of importing the data.
I use the R function read.transaction to import and convert my data frame (a csv file) into a transaction class directly from my working directory when using R Studio. It appears that read.transaction does not work on Azure ML, and yet
I need my data to be in transaction class for the rest of the functions in arules to work. Therefore, how do I get around this?
Thank you.Thanks.
This is my R script:
library(arules)
library(arulesViz)
# Contents of optional Zip port are in ./src/
#source("src/MOD Targeting MBA ML.R");
Data = read.transactions("src/data.csv", format = "single", sep = ",", cols = c(1,2))
itemFrequencyPlot(Data, topN = 37, type = "absolute")
Baskets = apriori(Data, parameter = list(supp = 0.001, conf = 0.8))
inspect(Baskets)
Results = as(Baskets, "data.frame")
maml.mapOutputPort("Results")
And this is the output log:
Record Starts at UTC 12/23/2014 19:52:51:
Run the job:"/dll "ExecuteRScript, Version=6.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca;Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript;Run" /Output0 "..\..\Result Dataset\Result Dataset.dataset" /Output1 "..\..\R Device\R Device.dataset" /bundlePath "..\..\Script Bundle\Script Bundle.zip" /rStreamReader "script.R" "
Starting process 'C:\Resources\directory\c3626c2575d5423e8cb58a9e7230be5e.SingleNodeRuntimeCompute.Packages\AFx\6.0\DllModuleHost.exe' with arguments ' /dll "ExecuteRScript, Version=6.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca;Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript;Run" /Output0 "..\..\Result Dataset\Result Dataset.dataset" /Output1 "..\..\R Device\R Device.dataset" /bundlePath "..\..\Script Bundle\Script Bundle.zip" /rStreamReader "script.R" '
[ModuleOutput] DllModuleHost Start: 1 : Program::Main
[ModuleOutput] DllModuleHost Start: 1 : DataLabModuleDescriptionParser::ParseModuleDescriptionString
[ModuleOutput] DllModuleHost Stop: 1 : DataLabModuleDescriptionParser::ParseModuleDescriptionString. Duration: 00:00:00.0050971
[ModuleOutput] DllModuleHost Start: 1 : DllModuleMethod::DllModuleMethod
[ModuleOutput] DllModuleHost Stop: 1 : DllModuleMethod::DllModuleMethod. Duration: 00:00:00.0000598
[ModuleOutput] DllModuleHost Start: 1 : DllModuleMethod::Execute
[ModuleOutput] DllModuleHost Start: 1 : DataLabModuleBinder::BindModuleMethod
[ModuleOutput] DllModuleHost Verbose: 1 : moduleMethodDescription ExecuteRScript, Version=6.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca;Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript;Run
[ModuleOutput] DllModuleHost Verbose: 1 : assemblyFullName ExecuteRScript, Version=6.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca
[ModuleOutput] DllModuleHost Start: 1 : DataLabModuleBinder::LoadModuleAssembly
[ModuleOutput] DllModuleHost Verbose: 1 : Trying to resolve assembly : ExecuteRScript, Version=6.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca
[ModuleOutput] DllModuleHost Verbose: 1 : Loaded moduleAssembly ExecuteRScript, Version=6.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca
[ModuleOutput] DllModuleHost Stop: 1 : DataLabModuleBinder::LoadModuleAssembly. Duration: 00:00:00.0074580
[ModuleOutput] DllModuleHost Verbose: 1 : moduleTypeName Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript
[ModuleOutput] DllModuleHost Verbose: 1 : moduleMethodName Run
[ModuleOutput] DllModuleHost Information: 1 : Module FriendlyName : Execute R Script
[ModuleOutput] DllModuleHost Information: 1 : Module Release Status : Release
[ModuleOutput] DllModuleHost Stop: 1 : DataLabModuleBinder::BindModuleMethod. Duration: 00:00:00.0116536
[ModuleOutput] DllModuleHost Start: 1 : ParameterArgumentBinder::InitializeParameterValues
[ModuleOutput] DllModuleHost Verbose: 1 : parameterInfos count = 5
[ModuleOutput] DllModuleHost Verbose: 1 : parameterInfos[0] name = dataset1 , type = Microsoft.Numerics.Data.Local.DataTable
[ModuleOutput] DllModuleHost Verbose: 1 : Set optional parameter dataset1 value to NULL
[ModuleOutput] DllModuleHost Verbose: 1 : parameterInfos[1] name = dataset2 , type = Microsoft.Numerics.Data.Local.DataTable
[ModuleOutput] DllModuleHost Verbose: 1 : Set optional parameter dataset2 value to NULL
[ModuleOutput] DllModuleHost Verbose: 1 : parameterInfos[2] name = bundlePath , type = System.String
[ModuleOutput] DllModuleHost Verbose: 1 : parameterInfos[3] name = rStreamReader , type = System.IO.StreamReader
[ModuleOutput] DllModuleHost Verbose: 1 : parameterInfos[4] name = seed , type = System.Nullable`1[System.Int32]
[ModuleOutput] DllModuleHost Verbose: 1 : Set optional parameter seed value to NULL
[ModuleOutput] DllModuleHost Stop: 1 : ParameterArgumentBinder::InitializeParameterValues. Duration: 00:00:00.0102003
[ModuleOutput] DllModuleHost Verbose: 1 : Found trace source in Execute R Script module...
[ModuleOutput] DllModuleHost Verbose: 1 : Begin invoking method Run ...
[ModuleOutput] Microsoft Drawbridge Console Host [Version 1.0.2108.0]
[ModuleOutput] [1] 56000
[ModuleOutput]
[ModuleOutput] The following files have been unzipped for sourcing in path=["src"]:
[ModuleOutput]
[ModuleOutput] Name Length Date
[ModuleOutput]
[ModuleOutput] 1 data.csv 2875965 2014-12-04 17:08:00
[ModuleOutput]
[ModuleOutput] 2 __MACOSX/ 0 2014-12-23 09:39:00
[ModuleOutput]
[ModuleOutput] 3 __MACOSX/._data.csv 120 2014-12-04 17:08:00
[ModuleOutput]
[ModuleOutput] Loading objects:
[ModuleOutput]
[ModuleOutput] Loading required package: Matrix
[ModuleOutput]
[ModuleOutput]
[ModuleOutput]
[ModuleOutput] Attaching package: 'arules'
[ModuleOutput]
[ModuleOutput]
[ModuleOutput]
[ModuleOutput] The following objects are masked from 'package:base':
[ModuleOutput]
[ModuleOutput]
[ModuleOutput]
[ModuleOutput] %in%, write
[ModuleOutput]
[ModuleOutput]
[ModuleOutput]
[ModuleOutput] Loading required package: grid
[ModuleOutput]
[ModuleOutput]
[ModuleOutput] Attaching package: 'arulesViz'
[ModuleOutput]
[ModuleOutput] The following object is masked from 'package:base':
[ModuleOutput]
[ModuleOutput] abbreviate
[ModuleOutput]
[ModuleOutput] $value
[ModuleOutput] NULL
[ModuleOutput]
[ModuleOutput] $visible
[ModuleOutput] [1] FALSE
[ModuleOutput]
[ModuleOutput] Warning messages:
[ModuleOutput] 1: In strptime(x, format, tz = tz) :
[ModuleOutput] unable to identify current timezone 'C':
[ModuleOutput] please set environment variable 'TZ'
[ModuleOutput] 2: In strptime(x, format, tz = tz) : unknown timezone 'localtime'
[ModuleOutput] DllModuleHost Stop: 1 : DllModuleMethod::Execute. Duration: 00:00:14.5396895
[ModuleOutput] DllModuleHost Error: 1 : Program::Main encountered fatal exception: Microsoft.Analytics.Exceptions.ErrorMapping+ModuleException: Error 0063: The following error occurred during evaluation of R script:
[ModuleOutput] ---------- Start of error message from R ----------
[ModuleOutput] Error: Mapped variable must be of class type data.frame at this time.
[ModuleOutput]
[ModuleOutput]
[ModuleOutput] Error: Mapped variable must be of class type data.frame at this time.
[ModuleOutput] ----------- End of error message from R -----------
Module finished after a runtime of 00:00:14.6091783 with exit code -2
Module failed due to negative exit code of -2
Record Ends at UTC 12/23/2014 19:53:07.
Sorry, it won't let me send a link for some reason.
Thanks.
Cindy -
FDM Like Mapping Script for Account
I am using the following script as a "Like" map for the Account. The import file has account in this format: 123456-Description. I would like to remove everything after the "-" and set the result to just the account number; however, I keep getting an error saying Conditional Map Script Error: Expected 'End' at line(4)
sParse="-"
ipos=InStr(varValues(13),sParse)
If iPos=0 Then Result=varValues(13)
Else Result=Left(varValues(13),iPos-1)
End If
Anyone know how to resolve the error? I tried moving the End If up to line 4, but that didn't help.
Thanks.
Terri T.The setting of the RESULT must be on its own line of the If statement as follows:
sParse="-"
ipos=InStr(varValues(13),sParse)
If iPos=0 Then
RESULT=varValues(13)
Else
RESULT=Left(varValues(13),iPos-1)
End If -
FDM Conditional Map Script Error
Hi all,
we trying importing data from EBS to HFM though ERPI by using FDM.
We used conditional based scripts to importing data from ebs to FDM.
this scripts used in FDM for ICP dimension between conditional mapping script.script logic is some particular account are related to Intercomapny transaction accounts we have to map to ICP member
can anyone help me on this:
this is error :
** Begin FDM Runtime Error Log Entry [2011-12-12 15:10:18] **
ERROR:
Code............................................. 1014
Description...................................... Conditional Map Script Error: Expected 'End' at line(2)
Script:
If varValues(14)="113401" Then Result="21_ADNIP"
Else Result="[ICP NONE]"
End if
Rule=I1
Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
Component........................................ upsWObjectsDM
Version.......................................... 1112
Thread........................................... 13888
IDENTIFICATION:
User............................................. admin
Computer Name.................................... ADNIPHYPUAT01
App Name......................................... FDMHFM
Client App....................................... WebClient
CONNECTION:
Provider......................................... ORAOLEDB.ORACLE
Data Server......................................
Database Name.................................... HYPUAT
Trusted Connect.................................. False
Connect Status.. Connection Open
GLOBALS:
Location......................................... HFMGLLOAD
Location ID...................................... 750
Location Seg..................................... 4
Category......................................... WLCAT
Category ID...................................... 12
Period........................................... May - 2011
Period ID........................................ 5/31/2011
POV Local........................................ False
Language......................................... 1033
User Level....................................... 1
All Partitions................................... True
Is Auditor....................................... False
Thanks.
SriniHi, please try the mapping script again having the "Result=" statement on a separate line, like:
If varValues(14)="113401" Then
Result="21_ADNIP"
Else
Result="[ICP NONE]"
End if
Kind regards,
Jeroen -
Can I use an Image Map to link to an SLP
I am working on a project starting with the Desktop Catalog with Homepage layout, and have created 4 additional generic SLPs. I added an image to the homepage slp and would like to use an image map to link to the 4 generic slps that I created. But I get an error when running the site and clicking on any of the image map links. Clicking on the link opens a new window with a "This program cannot display the webpage". At times I have gotten a script error when clicking the link rather than the This program... message, but I cant seem to replicate that at the moment.
I am able to do a simple hyperlink on the image to an slp, but this, of course, only gives me the ability to link to one of my additional pages....
Any ideas?
JohnI did finally figure this out... it is possible to map to an slp file from an image map... the trick has to do with how slp files work in RH,and makes sense, sort of, once I got it to work. When you generate html5, htm files are generated fromthe slps.
When you link to an slp file in a regular hyperlink, during the generation of the site, RH translates the slp refernce to the htm file reference that is generated from the slp. But for some reason, i.e., a bug IMHO, with an image map, when you link to an slp file, RH does not convert this slp reference to the .htm reference (as it does with normal, non-image map hyperlinks.
So the way to get this to work, is when you create the image map link, put in the htm file name that will be created during generation.
John -
Need help to write mapping script in OVD
Hi All,
I have a requirement to write a mapping script in python that can rename the attributes of OVD.
ex: cn with mycn, sn with mysn etc.,
Here is the code I have written to achieve that:
class MapperAttributeRenameClass(Mapping):
iattributes = {'rcn':'cn','rsn':'sn','ruserPassword':'userPassword'}
oattrubutes = {'cn':'rcn','sn':'rsn','userPassword':'ruserPassword'}
def inbound(self,mapUtil):
"@sig public void inbound(com.octetstring.vde.chain.plugins.mapper.MapperUtil mapUtil)"
mapUtil.renameAttribute(self.iattributes)
def outbound(self,mapUtil):
"@sig public void outbound(com.octetstring.vde.chain.plugins.mapper.MapperUtil mapUtil)"
mapUtil.renameAttribute(self.oattributes)
Can anyone help me how to go about it as I am new to Python?
Regards,
Sunil KumarHi
If you are unix user...
you can use script like below:
# $2 is the output filename, $1 is the .sql script
runsql()
sqlplus -s user/passwd/@somewhere <<EOF > $2
start $1
exit
EOF
runsql file1.sql logfile1 &
runsql file2.sql logfile2 &
runsql anotherfile.sql logfile3 &
wait -
How to search in Pages for any number or any character, using wildcards
Is it possible in Pages to use wildcards to search for any instance of any number? For example, I want to find all occurrences of any one or two digits followed by a colon, such as 8: or 37:
If I can't use wildcards, is there any other way to search, other than tediously searching for every instance of 1, every instance of 2, etc.?
Thanks!
SueHello
Here is an enhanced version.
--[SCRIPT highlight_ digitspluscolon]
Enregistrer le script en tant que Script : highlight_ digitspluscolon.scpt
déplacer le fichier ainsi créé dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Pages:
Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.
Ouvrir un document traitement de textes Pages
aller au menu Scripts , choisir Pages puis choisir highlight_ digitspluscolon
Dans les éléments de texte, l'arrière plan des groupes de chiffres
suivis d'un caractère deux points sera mis en rouge.
--=====
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
--=====
Save the script as a Script: highlight_ digitspluscolon.scpt
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
Maybe you would have to create the folder Pages and even the folder Applications by yourself.
Open a Pages word processor document.
go to the Scripts Menu, choose Pages, then choose "highlight_ digitspluscolon"
In the text objects, the background of groups of digits
with a trailing colon will be set to red.
--=====
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
--=====
Yvan KOENIG (VALLAURIS, France)
2010/07/17 -- enhanced to treat also text boxes and shapes
--=====
on run
local en_liste, le_dernier, un_groupe, le_premier, recul
local les_boites, une_boite, les_formes, une_forme
Try to treat the main text layer
tell application "Pages"
try
set le_document to name of document 1
tell document 1 to set le_texte to body text
on error
set le_texte to ""
end try
end tell -- Pages
if le_texte > "" then
set en_liste to my decoupe(le_texte, ":")
set le_dernier to 0
tell application "Pages" to tell document le_document
repeat with i from 1 to count of en_liste
set un_groupe to item i of en_liste
set le_dernier to le_dernier + 1 + (count of un_groupe)
set recul to 0
repeat with j from 1 to 10
if character -j of un_groupe is in "0123456789" then
set recul to -j
else
exit repeat
end if
end repeat -- with j
if recul < 0 then
set le_premier to le_dernier + recul
set character background color of characters le_premier thru le_dernier to {65535, 0, 0}
end if -- recul < 0
end repeat -- with i
end tell -- Pages…
end if -- le_texte > ""
Try to treat text boxes
try
tell application "Pages" to tell document le_document to set les_boites to every graphic whose class is text box
on error
set les_boites to {}
end try
if les_boites is not {} then
repeat with une_boite in les_boites
tell application "Pages" to tell document 1
tell une_boite to set le_texte to object text
end tell -- Pages…
my highlight(le_document, une_boite, le_texte)
end repeat
end if -- with f
Try to treat shapes
try
tell application "Pages" to tell document 1 to set les_formes to every graphic whose class is shape
on error
set les_formes to {}
end try
if les_formes is not {} then
repeat with f from 1 to count of les_formes
I know that using whose is more efficient than using an index but, in Pages '09, whose doesn't apply to shapes. *)
tell application "Pages" to tell document 1
set une_forme to item f of les_formes
tell une_forme to set le_texte to object text
end tell -- Pages
my highlight(le_document, une_forme, le_texte)
end repeat -- with f
end if
end run
--=====
on highlight(un_document, un_contenant, son_Texte)
local en_liste, le_dernier, un_groupe, recul, le_premier
set en_liste to my decoupe(son_Texte, ":")
set le_dernier to 0
tell application "Pages" to tell document un_document to tell un_contenant to tell object text
repeat with i from 1 to count of en_liste
set un_groupe to item i of en_liste
set le_dernier to le_dernier + 1 + (count of un_groupe)
set recul to 0
try (*
Useful if a shape was erroneously pasted in a text box. *)
repeat with j from 1 to 10
if character -j of un_groupe is in "0123456789" then
set recul to -j
else
exit repeat
end if
end repeat
end try
if recul < 0 then
set le_premier to le_dernier + recul
set character background color of characters le_premier thru le_dernier to {65535, 0, 0}
end if
end repeat
end tell -- Pages
end highlight
--=====
on decoupe(t, d)
local oTIDs, l
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe
--=====
--[/SCRIPT]
It scans the main text layer in Word Processor documents.
It scans text boxes and shape in Word Processor and Layout documents.
Is it useful to scan :
headers, footers, tables ?
Yvan KOENIG (VALLAURIS, France) samedi 17 juillet 2010 21:07:04 -
Hey guys,
Would appreciate some help with a mapping script I am using. I am getting this error when IMPORTING the file. This script is in the LIKE mapping for the Custom 2 dimension. varValues(20) is target Custom 1 so I wouldn't expect that value to be null. Also, why is this script processing on IMPORT? Custom 1 mapping is not processed yet so varValues(20) would be null until the maps are processed. I checked the processing order of the dimensions and Custom1 processes before Custom2.
How can I fix this script to work?
Here is the script and error:
Result = Mid(varValues(20), inStr(varValues(20), (len(varValues(20))-inStr(varValues(20), "_"))))
Error: An error occurred importing the file.
Detail: Conditional Map Script Error: Invalid use of Null: 'inStr(...)' at line(1)
The point of the script is to pull the cost center out of the target custom 1 which is to the right of the "_". Here's an example:
Target Custom1 = Chicago_Scrap
Custom2 = ScrapTry this instead
vaSplit = Split(varValues(20),"_")
Result = vaSplit(1) -
Using wildcards (*) in sender file adapter - FTP type
Hi guys!
Dooes it work using wildcards in sender file adapter (FTP type(!) (filesystem obviously work))? I tried it and it failed. it works only for exact name..
I read some articles about FTP and the result is, that ftp work always only with 1 file, so I'm wondering, if this is possible.
Thanks for info!
OlianThanks for all replies..
I know of course, that * can be used, I use it in many scenarios too. But on a FileSystem. It is not working if the sender type is FTP.
*, ., *.dat, ... nothing like that works.. Just exact file name.
I am able to pick up file, if I specify it's exact name, so there should be no problem with permissions..
Please, I'd appreciate one reply with comfirmation: yes, we are using asterisk (*) , we access source files via FTP and they are processed.
Is there anybody with this experience, that it works?
Thank you!
Olian
Maybe you are looking for
-
Indesign doesn't find my documents
Hi... I am using Indesign CC 2014. When I want to open a document and search for a part of it#s name (like "flyer") there are no results shown. Even if I have at least 50 of such documents on my Mac. Second issue is: When I make a new form like a rec
-
When I hook my iphone 4 up to itunes, it does not show up on the left. It will not sync, and the lightning bolt charging indicator on the phone does not come on although it appears to be charging over time because the battery level has increasd. I am
-
Mail Backup and Address Book Sync w/o .Mac
Two part post, I apologize if this is confusing. 1. Is there a clean way to back up Apple Mail? It would be nice to be able to have text/RTF accessible documents - but even just a mbox format would suffice. 2. Currently to share an Address Book group
-
Vertical Menubar Displaying Problem
I have a Spry 2.0 Vertical Menubar that is not working right because it is bigger than the <div> is it sitting in. If it would display over the top of all the other <divs> in the page, I would be a happy camper. So I put: overflow:visible; in pr
-
I installed Elements 11 and immediately after opening (I can see my pictures) it closes. Same thing started happening with Elements 9 which is why I upgraded.