Problem in passing parameters in command line in desktop
Hi,
I am trying to generate reports from command line (Oracle Discoverer 4i Version 4.1.42.04.00) but I am facing problems when I try to pass date or numeric parameters. It seems to work with strings
The following command is successful when i pass string as parameters
C:\orant\DISCVR4\dis4usr.exe /connect reports/reports@orcl /opendb load_report_1 /batch /sheet 2 /parameter "P Date" "31-JUL-2006 Month End" /export xls c:\Temp\load_report_!
But in the following commands the command line execution stops when a worksheet with parameters is encountered. Once then parameter is entered the command line is executed successfully. In these problem cases it seems like the /parameter option is not being recognized. I have tried to pass parameters with double quotes, single quotes, without any quotes.
C:\orant\DISCVR4\dis4usr.exe /connect reports/reports@orcl /opendb "load report 2" /sheet 3 /parameter "Select P Day" "20-JUN-2006" /batch /export xls c:\Temp\load_Report_2
C:\orant\DISCVR4\dis4usr.exe /connect reports/reports@orcl /opendb "load report 3" /batch /sheet 1 /parameter "Enter Date Using Format YYYYMMDD" 20060703 /export xls c:\Temp\load_report_3
The only difference I can see is that I have not used double quotes in the command line that is successful in generating reports with parameters.
Any inputs will be appreciated - we are stuck in our project due to this issue. Many thanks.
Warm regards
Sucharita
Hi
I work in the same team as the original poster.
We tried by changing NLS_DATE_FORMAT for the oracle_home.
Just to clarify our issue I am describing it one more time below -
Using Disc desktop (4.1.42) we are trying to run the reports using command line interface. Any report that takes character input for the parameters ,is running fine in the batch mode without prompting.
Any report that takes Date/Numeric input for the parameters, though in batch mode, is prompting for user to give the parameters.We tried with quotes as well.
For Example -
1. Character input : when we run this command supplying the input parameter values (which are characters), report runs fine without prompting for values.
C:\orant\DISCVR4\dis4usr.exe /connect rep/rep@orals /opendb Schd_Report /batch /sheet 2 /parameter "Process Date" "31-JUL-2006 Month End" /export xls c:\audit_report_5
2. Date Input -
C:\orant\DISCVR4\dis4usr.exe /connect rep/rep@orals /opendb "DLS.Arrears Reports" /batch /sheet 1 /parameter "Please Enter Date Using Format YYYYMMDD" 20060703 /export xls c:\CA_arr
When we submit this we get a window prompting for the input values. So his is the issue.
Thanks
Raman
Similar Messages
-
Passing parameters via command line
I've been asked to write a routine in LabVIEW that will control an
instrument. The only problem is that this routine will be called by a
different piece of software (3rd party software that we've bought)and
we need to pass a parameter. The source application will allow
switches in the command line, but that is the only way. Is there a way
Labview can accept this ??Hi,
I'll mail you a vi to do this. Note that it will only work if you have an
application. (If not, you'll get the command line from labview...)
Regards,
Wiebe.
"Robert Barker" wrote in message
news:[email protected]..
> I've been asked to write a routine in LabVIEW that will control an
> instrument. The only problem is that this routine will be called by a
> different piece of software (3rd party software that we've bought)and
> we need to pass a parameter. The source application will allow
> switches in the command line, but that is the only way. Is there a way
> Labview can accept this ?? -
Pass parameters (fs command) between tabs on a Infoview
Hi,
Could I pass parameters (fs command) between tabs on a Infoview dashboard?
Tkank you.hi fadrielli,
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/8082c807-ec9a-2d10-b28e-eaef69416592
open the address and read the article.it gives the complete information regarding the content linking between the dashboards using FScommand.
thanks and regards,
ravi kishore. -
Pass Diadem Parameters through command line
Hi,
I am trying to run DIAdem through command line. I have no problem with this but can I pass a variable through the same.
I would like to pass T1 with some value through command line. Can anyone please help me how can I do this.
Expecting your earliest reply.
Thanks,
PriyaHi Priya,
I am not quite sure what you're trying to do. So are you running a DIAdem SCRIPT from the command line? Is your variable defined within your application? How is the variable initialized when you run the script from within DIAdem. Is it a user Input? Also how exactly are your running the script from the command line?
I hope to hear from you soon and I will post as soon as I get some info from you side. Thank you for your patience.
SijinK
National Instruments -
Various problems using extension manager with command line
Hello all,
We are installing our plugins to CS4/5/5.1 version of Adobe Photoshop as part of our installer and allow the users to select specific versions of Photoshop to install the panel for. There are a few old problems that I wanted to rant about for quite some while and now with a whole bunch of problems that the 5.1 update introduced I feel I just have to voice them. I will limit it to PC only as it seems to be the most troubled platform
#1 As we cannot install our plugin only by using the Extension Manager (simply because it cannot handle all we've to do upon the installation) we have to run commands from within the our installer, non-interactively, of course.
The interface to command line installation is xmancommand.exe (or "Extension manager (Version). exe" - not sure whether it makes any difference. ). Now the first question is how to find this executable on the target machine, from an installer. Users may specify different locations to install the Creative Suite and it certainly does NOT have to be C:\Program Files\...(or %PRGRAMFILES% in general). ATM we are using an odd place in the registry to to find the path to the most recent Extension Manager but first its sometimes overwritten by another installation and in any case it only shows ONE version of the extension manager which of course cannot handle other versions (see #2)
#2 Why the most recent version of Adobe Extension Manager (5.5) cannot install the extension for 5.0? Well, install it actually does, however its disabled for CS5 and it seems that the only way to enable it on this platform is to find previous (CS5) extension manager and to enable it. Oh, actually no - it doesn't work! The only way that I found here working is to find CS5 extension manager first, install the extension there and then use CS5.5 extension manager to enable it. Why do I need both utilities to manage my extensions?!
#3 The program is severely lacking in documentation AND it doesn't produce reasonable output messages, so determining what it can actually support is a puzzle. For example, why "Dreamweaver CS5" is a correct product name and "Photoshop CS5" is not (don't different teams talk to each other)? Ok, lets forget the consistency, but how do I make the utility output the list of all products it supports, in their magic token form that it will actually be understood if passed in in the command line? By trial and error? This menthod btw is also extremely painful: nany times when specifying wrong parameters the program doesn't provide any output and just shrugs "whatever, go figure it yourself"...
#4 Why the only way to enable/disable an extension in Photoshop seems to be using magic "productfamily" keyword that is not even listed on Adobe's help page for command line options (here: http://help.adobe.com/en_US/extensionmanager/cs/using/WSB4845EDD-14E5-476a-B749-FF328830D1 4F.html).? E.g. "xmancommand.exe" -suppress -remove product=Photoshop extension=OurExtension" will ALWAYS fail with a lovely "'Photoshop is not supported by Extension Manager CS5.5." error; I've tried "PhotoshopCS5", "Photoshop CS5", "PhotoshopCS5.1" "Photoshop CS5.1", "Photoshop-12" (mentioned in examples section in http://help.adobe.com/en_US/extensionmanager/cs/using/packaging_extension.pdf ) and a whole bunch of other permutations - none seem to work (see #3). Magic "productfamily=Photoshop" does work. But then it only aims the current version ("CS5.1") and I need it to work for CS5 (I'm not even mentioning CS4...."). Would there be any suggestions?
Really, the question is, how do we, third-party developers, are supposed to interact with the command-line utility without knowing where it is, what product names is capable to work with and without being able to target specific platforms (i86 vs x64 anyone (http://forums.adobe.com/thread/672537)? CS5 vs CS5.1 (above)?). I don't know what your test cases are for the command line tool (if any!), but this is simply insane, folks, simply insane.I am sorry for the poor documentation of Extension Manager which causes you so much trouble.
1. You can use BridgeTalk API to ask specific version of Extension Manager to do something. There is sample in packaging_extension.pdf about this. You don't need to know the installation path of Extension Manager. One thing to note is that the value of bt.target is version specific, i.e. "exman-5.0", "exman-5.5" send this message to different version of Extension Manager, so you can change this value to install/enable/disable/remove extensions using different version of Extension Manager. More detailed documentation of BridgeTalk can be found by clicking "Help" menu then clicking "Javascript Tools Guide CS5" in "Adobe ExtendScript Toolkit CS5".
2. Specific version of Extension Manager only manage extensions for corresponding version of product. You should use Extension Manager CS5 to install extensions for Photoshop CS5. The reason that the extension you installed for Photoshop CS5.1 using Extension Manager CS5.5 is displayed for Photoshop CS5 in Extension Manager CS5 is that two versions of Photoshop specified the same directory for Extension Manager to manage extensions. This is a defect and will cause some problems if multiple versions of Photoshop co-existed in one machine. But "to find previous (CS5) extension manager and to enable it" should work for you, I guess you use command line to enable it and specify wrong product name (see #3) so that it doesn't work.
3. When using command line, you should specify "product" attribute with the name displayed at the left panel of Extension Manager. So "Photoshop CS5 32" is correct. Remember to enclose it with double quote because of existence of space character.
4. As above mentioned, use display name of Photoshop, and call proper version of Extension Manager by BridgeTalk. -
Problem running DNG Converter from command line in Windows XP
I'm a frustrated user trying to run Adobe DNG converter from the Windows command line - more specifically from a batch file.
- Am reasonably conversant with writing batch files
- Have read the PDF file provided by Adobe
I just can't figure the correct syntax for adding the command line parameters and, unfortunately, the Adobe PDF file doesn't have verbose examples for idiots like me. Nor can I find any such examples on the Net, or any discussion of this problem in the forums.
The Adobe PDF instructions state...
"The parameter list includes the conversion options you want to use, followed by the names of the files to convert."
As there is no switch to prefix 'the names of the files to convert' I assume I just leave a space and include the path to the source files at the end of the parameter list?
Here is the batch file line I am trying to use...
"C:\Program Files\Adobe\Adobe DNG Converter.exe [parameter list]"
Where I want to specify in the [parameter list] that...
(a) The destination directory (-d <directory> parameter) is c:\DNG_files
(b) And the source files are in directory c:\RAW_files
Here is the batch line with the parameters entered...
"C:\Program Files\Adobe\Adobe DNG Converter.exe -dC:\RAW_files c:\DNG_files"
I've tried variations of this with space between -d and C:\RAW_files and C:\DNG_files\*.* for the source files parameter.
I just keep getting DOS erros like "The filename, directory name or volume label syntax is incorrect"
Can anybody help me. I'm clueless how to solve the problem. :-(
I'm running DNG COnverter version 4.2
Thanks in anticipation.
RobThanks for responding G Sch.
LOL. Well this lemming doesn't habitually rename .exe files (e.g. Adobe DNG Converter.exe) to a non-spaced alternative either! (Adobe_DNG_Converter.exe)
Still no luck...
*** Here is my batch file...
REM Copy and DNG-convert files from CF
CD c:\RAW_files
dir c:\RAW_files
"C:\Program Files\Adobe\Adobe DNG Converter.exe" -d C:\DNG_files
dir c:\DNG_files
pause
***Here's the DOS shell output...
<<BEGINS>>
C:\RAW_files>dir c:\RAW_files
Volume in drive C is Local Disk
Volume Serial Number is D084-58ED
Directory of c:\RAW_files
12/03/2008 10:29 AM <DIR> .
12/03/2008 10:29 AM <DIR> ..
11/03/2008 07:00 AM 10,661,632 _3110455.ORF
11/03/2008 07:01 AM 10,661,632 _3110457.ORF
11/03/2008 07:01 AM 10,661,632 _3110458.ORF
11/03/2008 07:02 AM 10,661,632 _3110460.ORF
11/03/2008 07:02 AM 10,661,632 _3110461.ORF
11/03/2008 07:03 AM 10,661,632 _3110462.ORF
11/03/2008 07:03 AM 10,661,632 _3110463.ORF
11/03/2008 07:04 AM 10,661,632 _3110464.ORF
11/03/2008 07:04 AM 10,661,632 _3110465.ORF
9 File(s) 95,954,688 bytes
2 Dir(s) 2,619,731,968 bytes free
C:\RAW_files>"C:\Program Files\Adobe\Adobe DNG Converter.exe" -d C:\DNG_files
C:\RAW_files>dir c:\DNG_files
Volume in drive C is Local Disk
Volume Serial Number is D084-58ED
Directory of c:\DNG_files
12/03/2008 02:46 PM <DIR> .
12/03/2008 02:46 PM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 2,619,731,968 bytes free
C:\RAW_files>pause
Press any key to continue . . .
<<ENDS>>
As you can see (a) Source files exist(b) DNG command line runs without generating an error (c) no output files in destination.
DNG Converter did not run.
If I remove everything after the command (i.e. the parameter list stuff) it fires up DNG Converter in interactive mode. Not what I'm after.
Any other thoughts on what the problem is?
Thank you.
Rob -
How to pass arguments from command line to the .jsx
Hi, I have a .jsx file that does some scripting with photoshop. I would like to be able to call that script from the command line and pass some arguments. I have been going off of the forum at http://support.muse.adobe.com/thread/290023, mainly the last post. Here it is ...
command line example : runjavascript.vbs c:\mydirectory\test.jsx arg0 arg1 arg2 arg3
=====start runjavascript.vbs ===============
Set vbsArguments = WScript.Arguments
If vbsArguments.Length = 0 Then
WScript.Echo "Argument(0) is `your script to execute"
WScript.Echo "Arguments(0+n) are passed to your script as argument(0) to argument(n-1)"
Else
ReDim jsxArguments(vbsArguments.length-2)
for i = 1 to vbsArguments.length - 1
jsxArguments(i-1) = vbsArguments(i)
Next
Set photoshop = CreateObject( "Photoshop.Application" )
photoshop.BringToFront
'DoJavaScript has 3 parameters
' syntax DoJavaScript(arg[0], arg[1], arg[2]]
'arg[0] == javascript file to execute, full pathname
'arg[1] == an array of arguments to past to the javascript
'arg[2] == AiJavaScriptExecutionMode: aiNeverShowDebugger = 1,, aiDebuggerOnError = 2 aiBeforeRunning = 3
' only use 1
Call photoshop.DoJavaScriptFile( vbsArguments(0), jsxArguments, 1)
End IF
=====end runjavascript.vbs ===============
=======start test.jsx ====================
#target photoshop
for( n = 0 ; n < arguments.length; n++ ){
alert("argument("+ n+")= " + arguments[n]);
=======end test.jsx ====================
In summary, it calls a VBScript from the command line and passing args to the VBScript where it will run the .jsx and pass along the args to the .jsx. This is all seems to work, except that the args never make it from the command line into the .jsx and I'm having trouble narrowing down why.
I know the args are getting into the VBScript from the command line because I can successfully print them out using WScript.Echo. The VBScript then takes the args and makes a new array called jsxArguments which just holds the arguments that are to be passed on to the .jsx as the second argument in the DoJavaScriptFile().
I cannot tell if the jsxArguments is correct or not. I added an isobject(jsxArguments) check in the VBScript which fails, but if I do a WScript.Echo jsxArguments(0) it will correctly print out the contents of the array at that position.
I know that the args are not getting into the .jsx because I added a line alert(arguments.length) which prints out 0.
Any help would be greatly appreciated. Thanks.I don't use VBS so this is just a guess based on what I have read in this forum. I think when you are passing an 'array' to javascript it needs to be a variant data type. My guess your arguments are not making it to the javascript because it it the wrong data type.
-
SCCM 2012 - Problems running vbscript or simple command line
Hey everybody, I'm having a heck of a time trying to get SCCM 2012 to deploy some very simple Vbscripts or even a simple command line. I need to deploy some registry fixes across the company as well as a Vbscript that uninstalls some old applications.
If I run these scripts/commands outside of SCCM everything works fine, inside of SCCM it always shows "succeeded" but it doesn't actually run correct on the client.
What's confusing to me is the use of distribution points when you're running a command line that doesn't actually have any source files. For instance this is what I'm trying to run "regedit /s \\servername\folder\registryfix.reg". I've also tried
a similar bat file as well with the same result. I've tried it with a source folder specified, I've tried it using Run Program From Server or Download locally. I've gone through everything I can think of but can't get it to work.
Similarly with a vbscript I'm trying "cscript.exe /s \\servername\folder\uninstallapps.wsf" and various different settings in the package deployment.
I'm really confused here guys so any help would be greatly appreciated. ThanksWhat I have found is that if you try and run the REG.EXE command line directly, either as a program or via a CMD/BAT file, the 64-bit redirection will occur. So, if you had something like this in a program or via a CMD/BAT file that ran against a 64-bit
system:
REG ADD HKLM\Software\Microsoft\Test /v Test /d Test
You would end up with this registry entry existing under:
HKLM\Software\Wow6432Node\Microsoft\Test
That's because SCCM uses the 32-bit launcher to take care of this and redirection occurs - You can see this via the "CCM32BitLauncher.log" on the client.
To work around this problem, I have done the following:
On a reference machine, create/export the registry entry I want into a *.reg file - An example export of "Test.reg" for the above mentioned registry entry would look something like this:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Test]
"Test"="Test"
2. Stick our "Test.reg" file in a source share, create a package with the share as the source content, and distribute it
3. Create a program for the package with a command line like this:
REG IMPORT Test.reg
This is obviously not as clean as having a command line with a package to distribute, but I find it works fine for me and gets around the redirection for registry entries. -
i have used 4 parameters to take a report
like
empno=parameter1
sal=parameter2
mgr=parameter3
if i want to make a report that have empno=10
sal=2300 and mgr=230
them simply we used on the report with
select=======
where empno=:parameter1 and sal=:parameter2 and mgr=:parameter3;
The PROBLEM IS HERE THAT IF I WANT TO TAKE REPORT ONLY BY EMPNO THEN OTHERE TWO LEFT BLANK AND THE REPORT SHOWS NOTHING AND IF I USED "OR" OPERATOR INSTEAD OF "AND"
select=======
where empno=:parameter1 OR sal=:parameter2 OR mgr=:parameter3;
THEN IT GOT ALL THE EMPNO ,ALL SAL AND AL MGR
SO PLEASE SOLVE MY PROBLEM HOW CAN I DO THAT TO TAKE AS MUCH PERMATER AS I REQUIRED AT THE TIME OF REPORTING
IF U HAVE ANY QUERY OR SOLUTION THEN reply me or SEND ME ON THIS MAIL
[email protected]
thank you
imran
nullhello,
there are two approaches :
1) re-phrase your query as follows
select ... where (empno = :p1 or :p1 is null) and (sal = :p2 or :p2 is null) ....
2) use lexicals for the whole where-clause
define a user parameter e.g. myWhereClause and assign the text of the where-clause you want to apply (including the where keyword).
re-phrase your query :
select ... &myWhereClause
this will enable you to have a changable where-clause at runtime ! you can change it in the after-parameterform-trigger and create a where-clause accroding to the passed parameters.
regards,
the oracle reports team
null -
Problem in passing parameters between flow task in a dynamic region
Hi,
I have a problem with the passing of parameters between task flow when it is executed within a dynamic region. To implement this, I followed the Baranovskis Andrejus Blog "JDeveloper 11g and ADF Task Flow Parameters" and everything works perfect as the task flow are not invoked from a dynamic region. But if the same task flow are converted to fragment of pages and executed in a dynamic region, the filter in the task flow that is called does not work, it does not return any records.
Any idea that I may be missing to make this work well?.
Thanks in advance.Hi Frank.
My case is the first, ie in a single dynamic region, a task flow call another passing parameters to filter data to display in the second, using a task flow call activitie. As I said in the message above, everything works well as both task flow to not become unbounded task flow with fragmet page.
Any ideas?
Thanks -
[RESOLVED] How I pass in my command-line variables disgusts me
Hello,
What I'm trying to do is to make an easily configurable script that the user can run with just a few basic command line variables (some of our users are not programmers.) Now, here's my problem, when it comes to extracting the variables from the command line, it's kind of messy. Lets say I have the following command:
$ ./hl_script.sh --config-file=config_abc.txt --rate=5000 --data-dump=/opt/dump_area -v
"-v" means verbose
Now, given the weird arrangement of the different types of command line arguments, I'd like to extract the salient parts of the information that I care about. However, at this moment, all I have is the "cut" command which can easily get into undefined behavior territory should the user misstype an input. I would love to know how you have done this and what your approach to this problem is.
This is the code that I have so far:
# this is where we run the initial test and check if the user entered the
# help flag in order to see how to properly use this application.
if [ $# -gt 1 ]; then
for argument in $@
do
if [ $argument = "--help" ]; then
echo "Here is how you would use this software and the flags that would"
echo " be useful."
echo " --help"
echo " Brings up this display and shows a listing of the options"
echo " that can be used to better utilize this app."
echo ""
echo " --config-file=N"
echo " Specify the config file that we'd like to use."
echo ""
exit 0
elif [ `cut $argument | cut -d'=' -f 1` = "--config-file" ]; then
# read-in the config file that we specified and then proceed to set a
# bunch of environment variables that we need.
echo "stuff..."
fi
done
fi
Last edited by publicus (2014-05-13 13:13:43)ewaller wrote:
I know your sample code is Bash, but you may want to consider doing it in Python and using this library
Here is a simple Python program I wrote that uses the library:
ewaller$@$odin ~/devel/python 1004 %./sieve.py
Usage: sieve.py [options] arg
sieve.py: error: incorrect number of arguments
ewaller$@$odin ~/devel/python [2]1005 %./sieve.py 10
2 3 5 7
ewaller$@$odin ~/devel/python 1006 %./sieve.py --help
Usage: sieve.py [options] arg
Find prime numbers using a sieve of Eratosthenes
Options:
-h, --help show this help message and exit
-v, --verbose
ewaller$@$odin ~/devel/python 1007 %./sieve.py 10 -v
removing 4
removing 6
removing 8
removing 10
removing 6
removing 9
removing 10
2 3 5 7
ewaller$@$odin ~/devel/python 1008 %cat sieve.py
#! /usr/bin/python
Implement a sieve of Eratosthenes
from optparse import OptionParser
def main():
#Handle all the command line nonsense. We need a number as an argument
usage = "%prog [options] arg"
description = "Find prime numbers using a sieve of Eratosthenes"
parser = OptionParser(usage=usage,description=description)
parser.add_option("-v", "--verbose", action="store_true", dest="verbose")
(options, args) = parser.parse_args()
if len(args) != 1:
parser.error("incorrect number of arguments")
try:
maxval=eval(args[0])
except:
parser.error ("Argument is not a number")
# Here is the sieve
a=[x for x in range(0,maxval+1)]
for count in range(2,int(maxval/2)+1):
if a[count]:
for i in range(count*2,maxval+1,count):
a[i]=0
if options.verbose:
print ("removing %i"%i)
# and report the results
wrap=0
for count in range(2,len(a)):
if a[count]:
print (count,end=" ")
wrap += 1
if (wrap == 5):
print()
wrap = 0
print ()
if __name__ == "__main__":
main()
ewaller$@$odin ~/devel/python 1009 %
The thing is, I already have some shell code written that works, so I don't want to re-write (and re-test) that. -
How to pass arguments from command-line to Point(x,y)
Hi guys, I'm a beginner. i'm trying to figure this out 'how to pass the arguments from command-line to Point(x,y)'. See below is the code that i have written. But it appears eror. Is there anyone can help me to figure this out?
class day5FourDPoint {
int a = 0;
int b = 0;
int c = 0;
int d = 0;
day5FourDPoint rect(Point AB, Point CD) {
a = AB.x;
b = AB.y;
c = CD.x;
d = CD.y;
return this;
void printout() {
System.out.println("Four Dimension : " + a + b + c + d);
public static void main(String[] arguments) {
day5FourDPoint FD = new day5FourDPoint();
FD.rect(arguments);
if (arguments.length > 1 & arguments.length < 4) {
for (int i=0; i < arguments.length; i++) {
FD=Integer.parseInt(arguments);
FD.printout();
}I don't use VBS so this is just a guess based on what I have read in this forum. I think when you are passing an 'array' to javascript it needs to be a variant data type. My guess your arguments are not making it to the javascript because it it the wrong data type.
-
Problems Creating a CSV from command line
I have tried to create a csv file from the command line and get some unwanted lines of data in the output. Does anyone know how to create a csv without the extra lines from the command line.
I am using the following sequence of commands.
set wrap off
set termout off
set verify off
set heading off
set feedback off
set lines 900
set pages 9999
set newpage none
set embedded on
set colsep ','
set trimspool on
spool test6.lst
select * from rft;
spool off
When I run this from a script, I get exactly the data, which is what I want.
When I run this from the command prompt, I get an extra line at the start and one at the end of the csv file.
The data at the start is like this:
WMSP:wmsp:SQL*Plus> select * from rft;
The data at the end is like this:
WMSP:wmsp:SQL*Plus> spool off
Does anyone know how to keep these lines out of the data?
Thank you.>
The data at the start is like this:
WMSP:wmsp:SQL*Plus> select * from rft;
The data at the end is like this:
WMSP:wmsp:SQL*Plus> spool off
Does anyone know how to keep these lines out of the
data?
Well, a workaround could be to use one of the gazillions of utilities in Unix/Linux to remove all lines having the sql prompt (SQL>), right after your "test6.lst" file has been created.
I am using the "perl pie" for the same in the code snippet that follows:
$
$ cat create_csv.sh
#!/bin/bash
sqlplus -s test/test << EOF
set wrap off
set termout off
set verify off
set heading off
set feedback off
set lines 900
set pages 9999
set newpage none
set embedded on
set colsep ','
set trimspool on
set echo off
spool test6.lst
select * from t;
spool off
EOF
# remove the lines that have the sql prompt: SQL>
perl -pi -e "s/SQL\>.*$|^$\n//g" test6.lst
$
$ # run the script, dump stdout to the null device
$ create_csv.sh 1>/dev/null
$
$ cat test6.lst
1,a
2,b
3,c
4,d
$
$Note that the "test6.lst" on my system had the prompt "SQL>". You will have to tweak that regular expression so that it works for the prompt in your "test6.lst" file.
pratz -
Problem with tokenized input from command line
I am trying to take an input from the command line, parse it to tokens and perform whatever operation is needed depending on the name of the token, on a binary tree of stacks for example, if i type 1 2 1 3 printLevelOrder, then the root of the tree should have 3, 2,1 in the stack, the left child should have 1 and the right child should be empty. and then a level order print of the tree should be performed.
however what is happening when i run this code is the numbers are being put into the right stacks of the tree, but any commands such as printLevelOrder or PrintPopRoot are entering the code that is for placing numbers onto the stack instead of executing that command and skipping past this piece of code.
so my question is, why is the if statement if (word =="printLevelOrder") not being executed when thats whats in the word ?
example input and output shown below code fragment.
try {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
while (line != "***") {
System.out.print("> prompt ");
line = in.readLine();
StringTokenizer tokenizer = new StringTokenizer(line," ");
String word = new String();
while (tokenizer.hasMoreTokens()) {
word = tokenizer.nextToken();
boolean notCommand = true;
if (word =="printLevelOrder") {
theTree.printLevelOrder();
System.out.println("(word ==printLevelOrder)");
notCommand=false;
if (word == "printPopLevelOrder") {
theTree.printPopLevelOrder();
notCommand=false;
if (word == "printPopInorder") {
theTree.printPopInorder();
notCommand=false;
if (word == "printPopPreorder") {
theTree.printPopPreorder();
notCommand=false;
if (word == "printPopRoot") {
theTree.printPopRoot();
notCommand=false;
if (word == "***") {
notCommand=false;
if (notCommand == true) {
System.out.println("(notCommand == true)");
boolean notPlaced = true;
int v = 1;
while ((notPlaced==true) && (v < theTree.size())) {
if (theTree.element(v).isEmpty()) {
theTree.element(v).push(Integer.valueOf(word));
System.out.println("Inserting"+word);
System.out.println("in empty stack at location: "+v);
notPlaced=false;
if (notPlaced==true) {
if ( Integer.valueOf(word) >= Integer.valueOf( theTree.element(v).top().toString() ) ) {
theTree.element(v).push(Integer.valueOf(word));
System.out.println("Inserting"+word);
System.out.println("in stack at location: "+v);
notPlaced=false;
v++;
}valid inputs: int value, printLevelOrder, printPopLevelOrder, printPopInorder, p
rintPopPreorder, printPopRoot, *** to quit
prompt 1 3 2 4 2 printLevelOrder(notCommand == true)
Inserting1
in empty stack at location: 1
(notCommand == true)
Inserting3
in stack at location: 1
(notCommand == true)
Inserting2
in empty stack at location: 2
(notCommand == true)
Inserting4
in stack at location: 1
(notCommand == true)
Inserting2
in stack at location: 2
(notCommand == true)
Exception in thread "main" java.lang.NumberFormatException: For input string: "printLevelOrder"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.valueOf(Integer.java:553)
at TreeStack.main(TreeStack.java:73)
Press any key to continue . . .lol aww, shame that you forgot to do that. i had 10 / 10 for mine, and seing as the deadline is now well and trully over,
here is the entire source for anybody who was following the discussion or whatever and wanted to experiment.
additional files needed >
http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/Stack.java
http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/ArrayStack.java
http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/StackEmptyException.java
http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/StackFullException.java
/*TreeStack.java - reads command line input of values and assigns them to stacks in a binary tree and performs
operations on the ADT. valid inputs: <int>, printLevelOrder, printPopLevelOrder,
printPopInorder, printPopPreOrder, printPopRoot. Terminates on invalid input.
Written by George St. Clair.
S/N:0208456 22/11/2005
import java.util.Vector;
import java.io.*;
import java.util.StringTokenizer;
public class TreeStack {
private final int TREE_CAPACITY = 7 + 1;
private final int STACK_CAPACITY = 10;
Vector tree = new Vector(TREE_CAPACITY) ;
//collect input from command line, add values to stacks at nodes of the teee
//and perform required operations on the treestack
public static void main (String [] args) {
//create a tree of stacks
TreeStack theTree = new TreeStack ();
try {
//collect standard input
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
while (line != null) {
System.out.print("");
line = in.readLine();
//tokenise input
StringTokenizer tokenizer = new StringTokenizer(line," ");
String word = new String();
while (tokenizer.hasMoreTokens()) {
//assign word to the token
word = tokenizer.nextToken();
boolean notCommand = true;
//perform operation on treestack depending on what word is
if (word.equals("printLevelOrder")) {
System.out.println("printLevelOrder");
theTree.printLevelOrder();
notCommand=false;
if (word.equals("printPopLevelOrder")) {
System.out.println("printPopLevelOrder");
theTree.printPopLevelOrder();
notCommand=false;
if (word.equals("printPopInorder")) {
System.out.println("printPopInorder");
theTree.printPopInorder();
notCommand=false;
if (word.equals("printPopPreorder")) {
System.out.println("printPopPreorder");
theTree.printPopPreorder();
notCommand=false;
if (word.equals("printPopRoot")) {
System.out.println("printPopRoot");
theTree.printPopRoot();
notCommand=false;
//if word was not a command it must be a number
if (notCommand == true) {
boolean notPlaced = true;
int v = 1;
//starting at the root, find suitable place for number
while ((notPlaced==true) && (v < theTree.size())) {
//if the stack at v is empty, number goes here
if (theTree.element(v).isEmpty()) {
theTree.element(v).push(Integer.valueOf(word));
System.out.println("inserting: "+word);
System.out.println("in empty stack at location: "+(v-1));
notPlaced=false;
//if the stack is not empty
if (notPlaced==true) {
//if the value on the top of the stack is smaller than number, number goes onto the stack
if ( Integer.valueOf(word) > Integer.valueOf( theTree.element(v).top().toString() ) ) {
theTree.element(v).push(Integer.valueOf(word));
System.out.println("inserting: "+word);
System.out.println("in stack at location: "+(v-1));
notPlaced=false;
//if that node was no good, check the next one for suitability
v++;
catch (Exception e) {
//occurs when user inputs something that is neither a command, or a number, or upon EOF, or stack is full
public TreeStack () {
//create the TreeStack ADT by adding stacks in the vector, note vector 0 is instantiated but not used.
for (int i = 1;i<=TREE_CAPACITY;i++)
tree.add(new ArrayStack(STACK_CAPACITY));
public int size() {
//return the size of the tree +1 (as 0 is not used)
return tree.size();
public ArrayStack element (int v) {
//return the ArrayStack at v
return (ArrayStack)tree.get(v);
public int leftChild (int v ) {
//return left child of v
return v*2;
public int rightChild (int v ) {
//return the right child of v
return v*2+1;
public boolean children (int v ) {
//search for children of v and return true if one exists
for (int i =v;i<size();i++) {
if (i/2==v ) {
//left child found at i
return true;
if ((i-1)/2==v ) {
//right child found at i
return true;
//no children found
return false;
public boolean isInternal (int v ) {
//test whether node v is internal (has children)
if (children (v)== true) {
//has children
return true;
return false;
//print the top value in each stack encountered on a level-order traversal of tree
public void printLevelOrder() {
//for every node of tree v
for (int v = 1;v<size();v++) {
if (!element(v).isEmpty() ) {
//print the top value in stack v
System.out.println(" "+element(v).top());
else {
//stack at v is empty
System.out.println(" -");
//pop off and print the top value in each stack encountered on a level-order traversal of tree
public void printPopLevelOrder () {
//pop off and print the top value in stack v
for (int v = 1;v<size();v++) {
//for each node of tree v
if (!element(v).isEmpty() ) {
//if v isnt empty print the top value in stack v
System.out.println(" "+element(v).top());
//pop the top value in the stack at v
element(v).pop();
else {
//stack at v is empty
System.out.println(" -");
//pop off and print the top value in each stack encountered on an in-order traversal of tree
public void printPopInorder () {
printPopInorder (1);
public void printPopInorder (int v) {
boolean isInternal = false;
if (isInternal (v)) {
//use a boolean for isInternal to save on running the method twice
isInternal = true;
//recursively search left subtree
printPopInorder (leftChild(v));
//pop off and print the top value at v
if (element(v).isEmpty() ) {
//stack at v is empty
System.out.println(" -");
else {
//if v isnt empty print the top value in stack v then pop
System.out.println(" "+element(v).top());
element(v).pop();
if (isInternal ) {
//recursively search right subtree
printPopInorder (rightChild(v));
//pop off and print the top value in each stack encountered on an pre-order traversal of tree
public void printPopPreorder() {
printPopPreorder(1);
public void printPopPreorder(int v) {
//pop off and print the top value at v
if (!element(v).isEmpty() ) {
//if v isnt empty print the top value in stack v then pop
System.out.println(" "+element(v).top());
element(v).pop();
else {
//stack at v is empty
System.out.println(" -");
if (isInternal (v)) {
//recursively search left and right subtrees
printPopPreorder (leftChild(v));
printPopPreorder (rightChild(v));
//pop off and print all values from the stack at the root
public void printPopRoot (){
//while the root stack has values left
while (!element(1).isEmpty()) {
//print, then pop
System.out.println(" "+element(1).top());
element(1).pop();
} -
Hi all,
How can I to export a sheet using command line in Discoverer 10g? It's posible?
Thanks a lot.disco51.exe /connect user/password@db /opendb workbook /sheet sheet1 /export XLS c:\spreadsheet.xls /batch
(roughly)
also check out disco51.exe /?
Maybe you are looking for
-
Quicktime can't read a .dv file?
I can open the .dv file in VLC, but Quicktime gives me the error: "The document "HH Memorial.dv" could not be opened. The movie is not in a format that QuickTime Player understands." I thought .dv was a Quicktime format? Please help! Thanks.
-
I need to export the whole configuration of my project by bcc. I tried the export option in BCC, but this solution is nothing productive for a large project. Someone tell me some alternative to make a backup of my project?
-
After upgrading Foxfire 11 on my vista software, Adobe Flash Player - Ver 10.1. I downloaded and nothing is viewable. I have unchecked all security and my computer says it is updated and everything that I use in foxfire says the plugin are missing or
-
Which Printer/scanner Driver do I need ?
I have MACBOOK G4 OSX 10.4.11. Which driver do I need for the Epson Stylus PHOTO RX620 (and where do I get it ? Thanks.
-
I've been using a a configured system from Boxx Technologies for the past 5 years. I going to upgrade but not sure if I should go with a new system from Boxx... What are you guys using?