SQL*PLUS How to place argument inside string - sqlplus

I am passing a string into sql script in &1 and unplugging pdb. I am required to enter path to file location where the xml from unplug will be placed, I would like the path to contain the string passed in &1, something like this d:\Oracle\oradata\gl_db&1&1.xml.
The path itself needs to be quoted in SQLPLUS script, like this "d:\Oracle\oradata\gl_db&1&1.xml" where &1 would be replaced with the variable passed from powershell as "$Variable".
I suspect this problem has a really simple solution but I can't seem to figure it out, and would appreciate any help.

Actually, I found the answer myself, the issue was simply in the dot before xml extenstion, to have dot work correctly after &1(&1.), simply make it 2 dots, like this &1..

Related

Revit Ironpython Shell - Parsing a list of filenames with a number after a backslash in the path

I want to read in a list of files (inc path) from either a spreadsheet or a text file for some downstream processing. The list has been generated as a log from another process and the path includes a 2 digit year folder followed by a project number folder as follows:
\\servername\projects\19\1901001\project files\filetobeprocessed.abc
The problem is as soon as the above string is read in, it is interpreted as
\\servername\\projects\x019\x01901001\\project files\x0ciletobeprocessed.abc
Which then means that I cannot use the path to access the file.
Assigning the path string to a variable, I have tried:
thePath = repr(pathreadfromfile)
After assigning the path string I have tried fixing the string using
thePath.replace('\x0','\\')
thePath.replace('\\x0','\\')
thePath.replace(r'\x0','\\')
Nothing seems to fix the path so that it can be used to open the file.
I can't find anything in either python or Ironpython that suggests a fix for this programatically. I know that you can fix this is the path is known within the code by using r'' to use raw text to create the path.
Any help appreciated
Obviously, the backslash \ is interpreted as an escape character.
For a really simple solution, hopefully the simplest, I would suggest using forward slash / for all your path separators instead of backslash.
If you really need the backslash somewhere further down the road, you can replace them back again.

Powershell Parameter Passing

This seems so trivial, but I can't figure out why the parameters I'm passing into a .ps1 script from the command pane aren't getting captured correctly as shown in this image below. String parameters are just empty, numbers are 0 which tells me I've overlooked something basic! This is with Powershell v2.
Thanks mklement0.
It was, in fact, a path issue within the ISE

How to pass command-line args to my application when it has replaced Explorer.exe

I am using the techinque shown here and in a number of other places to cause my application to launch at start-up in place of Explorer (and Metro in Windows 8!) by creating a registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
with c:\xxxxx\MyApp.exe as the argument.
This works fine but I also need to pass it some arguments. I've tried this by making my key value (for example) "c:\xxxx\MyApp.exe" "arg1, arg2" but it would appear that arguments are being taken as a possible second start-up program with the comma as a delimiter. Can anyone advise how to pass arguments to a shell substitute? I've also tried double quotes with the same effect. Is it actually possible to pass arguments in this way? Or must I create some kind of launcher app to do this indirectly? I really do want my app to be the only kid on the block....
BTW I'm using Windows 8.0 and my app is written in Delphi.
AFAIK, you'd use the parameters just like you would in a batch file:
"C:\xxxxx\MyApp.exe" "%1" "%2" "%3" "%4" "%5"
In a batch (or the registry) the "%x" parameters have special meaning. They always mean "parameter X".

getting a substring from a text file for later use

I have a text file that contains version information. There are multiple lines, but the specific line i need looks like this:
#define SW_VERSION "3.4.3.1 R3 08-06-12"
I specifically need the 3.4.3.1 R3 from the text file.
My first thought was to do execute a short script that would grab this data out and use a set for later use, though i am having quite a bit of trouble getting it to work.
I ran this: Find /I "#define SW_VERSION" C:\SW\bin\SW_Version.txt
and it showed me the line in the file that i expected, but i couldn't figure out how to parse it afterwards. Help?
You can write a custom task for Ant.
Your custom task would parse the version line and extract the information you need.

How Can I Handle Parameters With Spaces in Delphi?

My program accepts input file names either as command line parameters or in a drag and drop operation or in Explorer by clicking on filenames with an extension that is associated with my program.
The command line and drag and drop work fine, but it is clicking on the filenames in Explorer that causes problems when the filepaths of the files clicked on have spaces in them, e.g.:
c:\temp\file one.txt
c:\my directory\filetwo.txt
c:\my directory\file three.txt
then, the ParamStr function gives me back:
ParamStr(1): c:\temp\file
ParamStr(2): one.txt
ParamStr(3): c:\my
ParamStr(4): directory\filetwo.txt
ParamStr(5): c:\my
ParamStr(6): directory\file
ParamStr(7): three.txt
How can I best reconstitute these back into the three filenames that I need?
It might be your shell file association that does not include the pair of "".
Like these ones for opening:
"C:\Program Files\WinRAR\WinRAR.exe" "%1"
or with DDE message:
[open("%1")]
Command-line parameters with spaces in them, such as filenames, should be quoted. This makes the param parser realize that it's supposed to keep them together. If the user's not quoting the filename, it's operator error.
If a drag-and-drop system is doing this, on the other hand, then you've got a bug in your drag-and-drop library and you need to talk to whoever created it. I'm a bit confused, though, as to why drag-and-drop operations are messing with ParamStr. That should only be set by the params passed to your program at the moment it's invoked, not once it's up and running. Maybe I'm missing something?
i use the CmdLineHelper unit, from here.

Resources