Open Dynamic file in a Directory
Hi,
I Have a Directory name like "Location" in that directory the users are post daily a file like IL0012, IL0013,ILdd like that.So i wnat to open that file in read mode so i tried to open like this
f1 utl_file.file_type;
begin
f1:=utl_file.fopen(location,'%IL%','r',6000);
end.
like that above i have permisions to Location directory.and also after reading file i want to delete that file If i have a fixed filen name i ma bale to read file but the problem is for dynamic file name.
any help
Your problem is not clear. What is the problem with dynamic file? Do you want to work with a single file or multiple files in that directory? If it is a single file then how do you determine which file you want to work with?
If you want to work with all the files there then probably try something like, loop through some dynamic construction of IL followed by 4 character left padded value of number from 1 to 31/365/whatever you want.
use the UTL_FILE.FGETATTR to know if the file exists, open it, read it and do what you want.
use the UTL_FILE.FREMOVE to delete the file, if you have permissions.
PS: I don't have permissions here to demonstrate an example.
HTH
Similar Messages
-
Dynamic File Name and Directory File Sender Adapter
Hello gurus,
I have a question: Is there any way to make the File Name, and Directory Dynamic of a File Sender Communication Channel ?
For example, taking it as a parameter from a Web Service Request.. (I mean, the only way with this would be a ccBPM). I don't exactly know if there is a way, I just thought about this.
Please tell me if someone could make Dynamic these 2 parameters while picking a file.
Regards,
Juanoops,thought i was replying to the PgP question:)
I think you should be able to achieve this via adapter module but i m not really sure how exactly it will be done .
Thanks
Aamir
Edited by: Aamir Suhail on Jul 28, 2009 1:42 PM -
How to open a file in any directory not only in current DIR
hi
i am new to java .
i have written the code for opening a file and reading the opened file.
i used filedialog to select a file for opening.
problem is it is opening a file only in the cuurent working directory.
i.e FileDialog.getFile() only returning the file name .what should i do to get the entire path of the file so that i can open a file any where in my System.plz give replies
fileDialog.getDirectory() + fileDialog.getFile() -
Open Excel File from oracle directory on a local machine
Hi,
I have an application where I generate a excel using data in a table and write excel file in oracle directory.Now my requirement is to open that file from local machine .How can i achieve it.
I am using Apex 4.2,Oracle 10g .
Thanks
Rajan.C
Edited by: Rajanjai on May 31, 2013 5:34 PMClose your question here and open here
Oracle Discussion Forums » Oracle Database » Application Express -
Opening dynamic files in ActiveX control
Hi,
I wana to open my files in activex control (file name is store in database) and i want to change the file in activex as i change my record.Plz help me how i can do that.
Thanx in Advance.
Zahid Mahmood.Hello William,
Have you seen this note already ??
Microsoft security patch KB834707 side effects in NW. SAP Note 785308 -
Open a file in same directory as app
I am trying to open a separate app that is in the same folder as the form app i'm using. Is there a way to do it so i can move the folder with the files in it from computer to computer and still have it work. I'm trying to open it with a jbutton
Thanks
Edited by: aschreiner22 on Apr 21, 2008 3:33 PMaschreiner22 wrote:
either another app, Look up the Process and Runtime class of the Java api. Usually if you want to execute another application like an .exe you would do this:
Process p = Runtime.getRuntime().exec("anotherApp.exe");
or a class embedded in an html.A class embedded in an html file? usually an Applet class. You can open the applet class like how you open other Java classes.
SampleAppletClass sample = SampleAppletClass();A word of advice, try Google and search your questions in this forum before asking. Chances are that other people have already ask them. Lot of users of this forum do not like to answer questions that have been asked before. You may receive unpleasant replies if you're not careful.
have a nice day! -
Acrobat Pro Won't Open PDF Files
I get this message when trying to click open pdf files in a directory. These files will open from Acrobat open file menu. Message - The document “SpecSheet_Zip.pdf” could not be opened. Acrobat cannot open files in the “Adobe PDF document” format. I'm using Mac OS 10.6 and acrobat pro 8.2.5. Any ideas how to fix would be appreciated.
The same thing happens with pdf files that are not zip files even if saved from Acrobat Pro on my computer.
-
Hi,
I am using Tomcat 4.0.4 as my servlet engine.
I have trouble in opening a file, when I want to open a file in current directory, I use
File counter = new File("counter.txt");
It points to the file c:\Tomcat\bin\counter.txt instead of the file in the directory d:\websites\servlets\WEB-INF\com\internal\servlet\counter.txt.
Is there any way I can open the file I want? Please help me and thank you in advance.Thank you. I get it done.
One more question. will different servlet engine gives different result in getRealPath("/"). Just want to make sure this technique works across different servlet engine. -
hi there,
How can i open a file, for example, a text file in JSP? Although i can do this if i place the file in a certain folder, i want to be able to open the file at any directory. Is it possible to do this?yeep.. since Jsp is essentially a servlet and running on the server you can open anything you want...
in your <%page%> tag you'll have to add import="java.io.*" and then use a FileInputStream or your favorite method of reading the file in and use out.print to display the text of it... kinda similar to:
<%page import="java.io.*" content-type="text/plain"%>
<%
FileInputStream tis=new FileInputStream("c:\windows\comsetup.log");
byte[] da=new byte[8192];
int len=tis.read(da);
while(len!=-1) {
out.write(da,0,len);
out.flush();
len=tis.read(da);
%>that'd do it.... you can change how the browser "reacts" by changing the content-type at the top... -
Hi
I was assigned a task in which a file has to be downloaded from a server. Right now, the code was already there which is written using applet. That is file is downloaded to local directory then it will get opened. Why cant I code in the following way.
1. Reading the file from the server and writing it to a local directory.
2. Opening the file from that directory using Desktop.getDesktop().open(file)
Since I am a newbie to java i could not understand the difference between these two things.
can anyone please explain me so that i can proceed with the right way.
Thanks in Advance.Dinesh wrote:
Hi
I was assigned a task in which a file has to be downloaded from a server. Right now, the code was already there which is written using applet. That is file is downloaded to local directory then it will get opened. Why cant I code in the following way.
1. Reading the file from the server and writing it to a local directory.
2. Opening the file from that directory using Desktop.getDesktop().open(file)This is highly confusing. What you describe is what is apparently implemented in this applet. So what do you want to code differently? And WHERE do you want to run this code? There must be a reason why it is right now an applet. Are you talking about a web environment like servlets/JSPs? -
To open a file where the filename is dynamic ......
String logfile=request.getParameter("value");
out.println(logfile);
FileInputStream fs1 = new FileInputStream("/opt/Abhishek/software/tomcat/webapps/AMS/Backend/History/");
DataInputStream in1 = new DataInputStream(fs1);
while (in1.available() !=0)
String str=in1.readLine();
out.println(str+"<br>");
}I have to display the available number of logfiles in a directory in a JSP page and once the logfile is clicked i need to show its contents.Once the logfile is clicked the filename is passed as a parameter to another JSP page the code shown above.In the above code i have the filename .And the File is available in the History Directory.I dont know what to put after the History .How to open the file that is mentioned by the value which is dynamic ????????
Any one could Please Help???????????????>
String logfile=request.getParameter("value");
FileInputStream fs1 = new FileInputStream("/opt/Abhishek/software/tomcat/webapps/AMS/Backend/History/" + logfile);? -
How to open and read many files from a directory and store contents in 2D array?
I want to make a VI that opens and reads the data from various files contained in a directory (200 files each with 2 columns) and store these in a single 2D array. For file number 1 I want to store the data from both columns in the 2D array, but for files 2 to 200 I only want to store the second column of each file. Can someone please help?
Hi Nadav,
Thanks for your help. I have followed your instructions but i cannot get it to work. I used the LIST DIRECTORY to list the files in the directory - that works. However, how do I read each of the 200 files using READ FROM SPREADSHEET FILE without me having to manually select each of the 200 files? So, if I use LIST DIRECTORY to list all 200 files in an array, how do I get each of these to open and store the data in a 2D array? Here is what I have done (File called read_files.VI) Could you please help me? Thank you very much in advance.
Attachments:
read_files.vi 18 KB -
Dear Experts,
Please note that I am facing a chllenge while confiuguring the VNCServer on the local test Server. The Local Test Sver OS Version is Redhat Enterprise Linux Server
Release 5.5 32-bit. Please review the following error message and advise me on how to fix the vncserver issue.
[root@test .vnc]# cat xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
gnome-session &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
[root@test .vnc]# cat /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-nohttpd" to prevent web-based VNC clients connecting.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERS="1:oracle"
[root@test .vnc]# ls
passwd test.oracle.co.zm:1.pid test.oracle.co.zm:3.log test.oracle.co.zm:5.pid test.oracle.co.zm:6.pid
test.oracle.co.zm:1.log test.oracle.co.zm:2.log test.oracle.co.zm:5.log test.oracle.co.zm:6.log xstartup
[root@test .vnc]# more test.oracle.co.zm:1.log
Xvnc Free Edition 4.1.2
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 70101000, The X.Org Foundation
Tue Mar 11 11:18:37 2014
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5901
vncext: Listening for HTTP connections on port 5801
vncext: created VNC server for screen 0
Could not init font path element unix/:7100, removing from list!
localuser:root being added to access control list
No profile for user 'root' found
SESSION_MANAGER=local/test.oracle.co.zm:/tmp/.ICE-unix/13603
Window manager warning: Log level 32: could not find XKB extension.
** (eggcups:13671): WARNING **: IPP request failed with status 1030
** (eggcups:13671): WARNING **: IPP request failed with status 1030
** (nm-applet:13697): WARNING **: No connections defined
Initializing nautilus-open-terminal extension
Unable to open desktop file /usr/share/applications/redhat-email.desktop for panel launcher: No such file or directory
Unable to open desktop file /usr/share/applications/openoffice.org-1.9-writer.desktop for panel launcher: No such file or directory
Unable to open desktop file /usr/share/applications/openoffice.org-1.9-impress.desktop for panel launcher: No such file or directory
Unable to open desktop file /usr/share/applications/openoffice.org-1.9-calc.desktop for panel launcher: No such file or directory
[root@test .vnc]#
Regards
Mohammed Abdul MuqeetHi,
Try these 3 solutions
1. Did you start vncserver services as:
service vncserver start
2.Check that port 5901 has not been blocked by a firewall:
# nc -vz localhost 5901
You should get a connection and a termination. If you get an error, fix the firewall.
3. service iptables stop
Hope This Helps
Regards,
-DK -
Script to open all PST files in a directory and open with Outlook.
Hi! I am looking for a script that opens all PST files in a directory, opens it in outlook, and writes to a log to see if it completed correctly. I'm new to VBscript and just want to see how the script would be written.
Thank you!!Thank you for all the input! JRV, I went through the repository and couldn't find anything about importing into Outlook. I will use it for future references and I appreciate you directing me there.
Grant, I need to be able to locate all PST files within a directory, not point it to a specific pst. I also need it written to a log file. Here is what I have...Don't laugh, I'm very new...
const ForAppending = 8
set objTextFile = objFSO.OpenTextFile ("C:\Users\jimmy.nguyen\Desktop\Lucky.txt", ForAppending, True)
set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
strCommand = "C:\Program Files (x86)\Microsoft Office\Office12\outlook.exe"
Set objExecObject = objShell.Exec(strCommand)
wscript.sleep 4000
Set myOlApp = CreateObject("Outlook.Application")
Set myNS = myolapp.GetNamespace("MAPI")
myNS.AddStore "objfile.name"
Sub ShowSubFolders(fFolder)
Set objFolder = objFSO.GetFolder(fFolder.Path)
Set colFiles = objFolder.Files
For Each objFile in colFiles
If UCase(objFSO.GetExtensionName(objFile.name)) = "pst" Then
objFile.Name
End If
Next
For Each Subfolder in fFolder.SubFolders
ShowSubFolders(Subfolder)
Next
End Sub
strResults = ShowSubFolders(fFolder)
objTextFile.WriteLine(strResults)
objTextFile.Close -
Dynamic File and Directory Name without Mapping
Hello Experts,
We have following requirement:
1) Files will be picked from R/3 AL11 directory and would be placed in corresponding folder in target system.
2) On source side ,there would be only one folder for all types of files(around 20),but on target side,there would be one folder for each kind of file(20 folders)
3) File name should be same on the target side but target directory should be selected based on file name.
I have gone through a number of posts related to similar requirements and hence,sorry for a new post but I am not yet able to find a solution to this.
I could understand,this can be achieved using DynamicConfiguration UDF .
But I have no possibility to have mapping in my scenario.It would just be a pass through scenario.
Can anyone please suggest a solution to this?
Thanks.
Regards,
ShwetaHello,
Thanks a lot for suggesting solution to this problem.
I could achieve this using following Java mapping:
import com.sap.aii.mapping.api.*;
import java.io.*;
import java.text.*;
import java.util.*;
public class GetDynamicConfiguration implements StreamTransformation {
private Map param;
public void setParameter(Map map1) {
this.param = map1;
public void execute(InputStream inputstream, OutputStream outputstream) throws StreamTransformationException {
try {
AbstractTrace trace = null;
// a) Set ouput File name
String directory=null;
trace = (AbstractTrace)param.get(StreamTransformationConstants.MAPPING_TRACE );
param.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic", StreamTransformationConstants.DYNAMIC_CONFIGURATION), "");
DynamicConfiguration conf = (DynamicConfiguration) param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
String filename =conf.get(key);
conf.put(key, filename);
trace.addInfo("File name is "+filename);
if(filename.equals("in.txt"))
directory = "/home/ftpxi/in";
if(filename.equals("test.txt"))
directory = "/home/ftpxi/in/test";
if(filename.equals("shweta27.txt"))
directory = "/home/ftpxi/in/test";
trace.addInfo("Directory name is "+directory);
conf.put(key1, directory);
// b) Just copy input file to output file
byte[] b = new byte[inputstream.available()];
inputstream.read(b);
outputstream.write(b);
} catch (Exception exception) {
exception.printStackTrace();
Thanks again.
Regards,
Shweta
Maybe you are looking for
-
How to find out the country details.
Hi friends, I have one requirement, i.e table have one column name country... Country_Name India Pakistan Afghanistan Albania Algeria American Andorra Angola Anguilla Antigua Argentina Armenia Aruba Australia Austria Azerbaijan Bahamas Bahrain Bangla
-
good evening everybody iam new to JavaMail i used an example from oracle site that uses JavaMail to send an email, the applications tells me that the email has been sent successfully, but sadly i did't find any new emails in the email inbox i sent to
-
Sound blaster live! 5.1 with a Audigy1 I/O Drive bay
OK, heres the deal. i've had my Audigy with I/O dri've bay for a while now and have been very happy with it, shunning on-board sound throughout numerous upgrades of my PC. the thing i love about it the most is the dri've bay because i used it to reco
-
Ise 1.1.1 missing Wireless LAN Controller (WLC) in Auth Profile
Anyone else not seeing the Wireless LAN Controller tick box in Authorization Profile? Clean install of 1.1.1. with ISE Version 1.1.1.268-Cumulative Patch 1 applied EVAL license All the documentation says it should still be there in 1.1.1 unless im mi
-
Since loading mavericks my calendar posts events one hour late. That is, if mtg invite is for 9am it posts at 10am. my pc clock and time zone are correct.