Loading multiple text files from a folder into oracle clob field
I would like to load about 300 word documents into a oracle clob field with each document inserted as a separate record.
I'm not quite sure how to go about doing this. Is there a utility in oracle that would do this?
I've looked at sql loader and utl_file but both require the name of the file. Is there a way I can do this?
If its not possible using just oracle, does anyone know how I can do this in combination with perl?
Many Thanks
Sam
I have no experience with this, but pl see if MOS Doc 73787.1 (How to Read A Binary File into BLOB Using PL/SQL) can help.
Essentially, you will have to write code to loop thru all 300 files to load them into the database
HTH
Srini
Similar Messages
-
Importing multiple jpeg files from local folder into database LOB column
I have to programatically save multiple pictures (jpeg) from the folder on my PC into Oracle table LOB column. I have to be able to choose local folder on my PC where are the pictures, and press button on Oracle Forms to save pictures in LOB column in database.
I'm using Forms 6i and Oracle 10g Rel2 database.
Is this possible with Oracle Forms or the only way to do that is to use create directory database command and use dbms_lob package which I shouldn't do, because Oracle database directory is not allowed to see my local folder.As I said I don't know how to use object data type, I just given a shot as below. I know the following code has errors can you please correct it for me.
Public
Sub Main()
' Add your code here
Dim f1
As FileStream
Dim s1
As StreamReader
Dim date1
As
Object
Dim rline
As
String
Dim Filelist(1)
As
String
Dim FileName
As
String
Dim i
As
Integer
i = 1
date1 =
Filelist(0) =
"XYZ"
Filelist(1) =
"123"
For
Each FileName
In Filelist
f1 = File.OpenRead(FileName)
s1 = File.OpenText(FileName)
rline = s1.ReadLine
While
Not rline
Is
Nothing
If Left(rline, 4) =
"DATE"
Then
date1 (i)= Mid(rline, 7, 8)
i = i + 1
Exit
While
End
If
rline = s1.ReadLine
End
While
Next
Dts.Variables(
"date").Value = date1(1)
Dts.Variables(
"date1").Value = date1(2)
Dts.TaskResult = ScriptResults.Success
End
Sub -
Pull multiple excel files in a folder into a table.
Hello,
I am using the instructions available in the link below to pull multiple excel files in a folder into a table.
http://stackoverflow.com/questions/6190578/how-to-import-excel-files-with-different-names-and-same-schema-into-database
The instructions use two variables FilePath & FolderPath which i would like to record into another table. I dont have coding experience and therefore i am stuck. I see the code above but i am unable to modify for my usage.
Any help would be greatly appreciated.TopCat,
If you wanna read the Filepath/FOlderpath values from a table int he database, use the Single row resultset option of Execute SQL task. That should help. refer:
http://stackoverflow.com/questions/18828498/ssis-set-multiple-variables-via-a-single-sql-task
http://technet.microsoft.com/en-us/library/cc280492.aspx (populating a variable with resultset section)
For recording the path variable data to a table in database, use ExecuteSQL task to achieve the functionality again:
Bind the variable data into a sql variable : smthin like
"INSERT INTO Data_Result(Result) VALUES ('"+@[USER::my_data]+"')"
Then use this sql variable as the statement to be executed in execute sql task.
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'> -
Loading a text file from a relative location in shockwave
Hi all
I'm REALLY sorry I have to post about such an inane problem.
I've googled this and looked in forums and found several
suggestions but none of them are working for me. I want to load a
text file from the same directory as my movie. I can get this
working in authoring mode, in a projector, and in a shockwave movie
on the local machine (using getNetText("/text.txt")).
But when i put the shockwave movie on a server, it does NOT
work. The macromedia documentation says that getNetText works with
relative URLs. But when I put in the full URL, it does work, so
obviously the shockwave movie is having a problem finding the text
file which IS in the same directory as it.
Any suggestions / ideas? All i want to do is access a text
file :)
Sorry again for such a lame problem
Mikethanks - this worked. I also had to not use a repeat loop to
wait for netDone() to return true.
Thanks again
MIke -
Every time a character is made in my app it is saved to an html file named after it in a folder called RpgApp on the sdcard
so if the characters name is john smith then there will be a john-smith.htm located in RpgApp folder on the sdcard
now that bit works great
the app also makes a list of buttons each one named after a file inside the RpgApp folder (so in this case there would be a button named john-smith.html ) and the content is the same as the name so it displays as john-smith.html
each button has the following method on click
private void htmlButtonClick(object sender, RoutedEventArgs e)
StorageFolder externalDevices = Windows.Storage.KnownFolders.RemovableDevices;
string curDir = externalDevices.ToString();
Button button = sender as Button;
Uri result = new Uri(String.Format("file:///{0}/RpgApp/"+button.Name,curDir));
web.Navigate(result);
now the idea is that when you click the button the webview control (aptly named "web") loads up the content of the file (you notice button.name as part of the url? well thats because the buttons name is the file name :)
but instead the browser remains unmoved, just sits thier blank
to test i changed web.Navigate(result); to web.NavigateToString(button.Name);
and sure enough when ever i clicked a button the webview displayed the name of the button i clicked
any ideas?Hi D.Eastwick,
I will recommand you read the html file content from the folder in the sd card and convert it to a string, after that we can use the
NavigateToString method to load the html content in the WebView.
Besides, please try to do a test by puting the html file in a
LocalFolder and use the URL like this: "ms-appdata:///...." to see if it works.
Best Regards,
Amy Peng
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Loading Data From a Text File Through an Application into Oracle
Hi There,
I have a web application that allows the user to upload a text file. This file is then processed by my application. Each line in the file is a new row I need to insert into my table.
Currently, I batch 200 updates together and insert them into the DB.
For about 3 million records this is taking much longer than I would like it to.
Any suggestions for optimization?
thanks.I put here a simplest demo (file has whitespace)
I think it may help to start.
--Structure of your file test1.dat (put in your directory)
a1 b1
a2 b2
a3 b3
a4 b4
CREATE OR REPLACE DIRECTORY
test_dir AS
'C:\oraclexe\DIR' --or anywhere
--GRANT READ, WRITE ON DIRECTORY test_dir TO your_user
--external table:
DROP TABLE test_ext
CREATE TABLE test_ext
(col1 CHAR(5),
col2 CHAR(5)
ORGANIZATION EXTERNAL
(TYPE oracle_loader
DEFAULT DIRECTORY test_dir
ACCESS PARAMETERS
(RECORDS DELIMITED BY NEWLINE
FIELDS TERMINATED BY WHITESPACE)
LOCATION ('test1.dat')
SELECT * FROM test_ext
COL1 COL2
a1 b1
a2 b2
a3 b3
a4 b4
Insert into another_table(another_col1, another_col2) (select col1, col2 from test_ext) if needed -
Problems loading a text-file from a shared NT network order
Hi @ all,
I try to upload a text file in MII that is destinated in a shared order in the NT file network.
I used text_loader with URL FILE://SERVERNAME/SHARE/input.txt and I get the error message "connection refused" even if I use credentials with an authorised user.
Do you have any idea why it does not work?
Thanks in advance!
SebastianHi,
For this you need to use FTP Input Action. Put all the files(you want to upload to MII) are in shared network into your FTP server.
Then use the FTP related actions in transaction. This is the best way.
Also see the similar [Thread|Re: Saving a file to an external system from MII server] and [Help|http://help.sap.com/saphelp_mii121/helpdata/en/44/710ca09ea03abee10000000a155369/content.htm]
Hope this helps you.
-Suresh -
Hi! I've got several archived text files - 040107.txt,
040207.txt, 040307.txt, for example - and I want to be able to
build a dynamic link which loads whichever file is selected into
the Flash movie. This list needs to be able to build itself as I
write new files every day and add the old ones to the archive. I'm
stumped. How can I do this?If you are using XML to load data, then use the CDATA to wrap
the html text.
If you are using LoadVars to load data, be sure you do not
have any & in the text content. If you do convert to hex.
Bottom line is you need to trace the text you load to see
what you are getting.
Flash should show HTML if you have the
TextField.htmll
property set to true which is also done in IDE with "Render Text as
HTML". But you must use the
TextField.htmlText
property to set the text.
Finally malformed HTML in Flash TextFields generally dies
like you describe.
You should be able to test the display of data in dynamic
TextFields with a simple Flash movie containing the TextField and
the text stored in a variable and then loaded into the htmlText
property. If it is not working there then you have to look at the
data. -
Hey!
Does anybody can help me to make an Excel VBA macro code in order to import data from text files into one Excel spread sheet? I want to create User Form with dropdown list where user can select start and end date of interest and macro code
will import bunch of text files depending on user demands... I am thinking to omit time tail (meaning that user can only specify date and I will add filename tail in macro code).
My text files are named: 20130619004948DataLog.txt (meaning: yyyy mm dd hh mm ss). Text file contains recordings for each 15 seconds... It would be great to omit time tail (meaning that user can only specify date) and make additional macro to add the time
tail to the file name, since it does not change from day to day. Text files for one day of interest (I have text files covering whole year):
20130619004948DataLog.txt
20130619014948DataLog.txt
20130619024948DataLog.txt
20130619034948DataLog.txt
20130619044948DataLog.txt
20130619054948DataLog.txt
20130619064948DataLog.txt
20130619074948DataLog.txt
20130619084948DataLog.txt
20130619094948DataLog.txt
20130619104948DataLog.txt
20130619114948DataLog.txt
20130619124948DataLog.txt
20130619134948DataLog.txt
20130619144948DataLog.txt
20130619154948DataLog.txt
20130619164948DataLog.txt
20130619174948DataLog.txt
20130619184948DataLog.txt
20130619194948DataLog.txt
20130619204948DataLog.txt
20130619214948DataLog.txt
20130619224948DataLog.txt
20130619234948DataLog.txtI am pretty sure this same question was asked about 2 weeks ago, and that one never got an answer. How about this?
Sub Read_Text_Files()
Dim sPath As String
Dim oPath, oFile, oFSO As Object
Dim r, iRow As Long
Dim wbImportFile As Workbook
Dim wsDestination As Worksheet
'Files location
sPath = "C:\Test\"
Set wsDestination = ThisWorkbook.Sheets("Sheet1")
r = 8
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oPath = oFSO.GetFolder(sPath)
Application.ScreenUpdating = False
For Each oFile In oPath.Files
If LCase(Right(oFile.Name, 4)) = ".txt" Then
'open file to impor
Workbooks.OpenText Filename:=oFile.Path, Origin:=65001, StartRow:=1, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, FieldInfo:=Array(1, 1), _
TrailingMinusNumbers:=True
Set wbImportFile = ActiveWorkbook
For iRow = 1 To wbImportFile.Sheets(1).UsedRange.Rows.Count
wbImportFile.Sheets(1).Rows(iRow).Copy wsDestination.Rows(r)
r = r + 1
Next iRow
wbImportFile.Close False
Set wbImportFile = Nothing
End If
Next oFile
End Sub
Or, this.
Sub TxtImporter()
Dim f As String, flPath As String
Dim i As Long, j As Long
Dim ws As Worksheet
Application.DisplayAlerts = False
Application.ScreenUpdating = False
flPath = ThisWorkbook.Path & Application.PathSeparator
i = ThisWorkbook.Worksheets.Count
j = Application.Workbooks.Count
f = Dir(flPath & "*.txt")
Do Until f = ""
Workbooks.OpenText flPath & f, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=True, _
Space:=False, Other:=False, TrailingMinusNumbers:=True
Workbooks(j + 1).Worksheets(1).Copy After:=ThisWorkbook.Worksheets(i)
ThisWorkbook.Worksheets(i + 1).Name = Left(f, Len(f) - 4)
Workbooks(j + 1).Close SaveChanges:=False
i = i + 1
f = Dir
Loop
Application.DisplayAlerts = True
End Sub
That's just a generic sample. So, basically, I'd modify the code like this.
Sub TxtImporter()
Dim f As String, flPath As String
Dim i As Long, j As Long
Dim ws As Worksheet
Application.DisplayAlerts = False
Application.ScreenUpdating = False
'flPath = ThisWorkbook.Path & Application.PathSeparator
flPath = "C:\Users\Ryan\Desktop\Dates\"
i = ThisWorkbook.Worksheets.Count
j = Application.Workbooks.Count
f = Dir(flPath & "*.txt")
VAL1 = ThisWorkbook.Sheets("Sheet1").Cells(1, 1).Value
VAL2 = ThisWorkbook.Sheets("Sheet1").Cells(1, 2).Value
f = Left(f, 8)
If f = VAL1 And f = VAL2 Then
Do Until f = ""
Workbooks.OpenText flPath & f, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=True, _
Space:=False, Other:=False, TrailingMinusNumbers:=True
Workbooks(j + 1).Worksheets(1).Copy After:=ThisWorkbook.Worksheets(i)
ThisWorkbook.Worksheets(i + 1).Name = Left(f, Len(f) - 4)
Workbooks(j + 1).Close SaveChanges:=False
i = i + 1
f = Dir
Loop
End If
Application.DisplayAlerts = True
End Sub
That will NOT work, because I don't know how you want to handle the time and 'DataLog.txt' part of the file name. Just decide what you want to do with that part of it, and modify the code appropriately.
Also, I'm assuming the dates (without times) are in A1 and B1 in Sheet1.
I think this gets you 99% of the way there. Post back if you have specific questions.
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it. -
Load & retrieve text files from lob column
Dear All,
I have created a table with CLOB column in it.
Now I have to inset text files into that column and retrieve the file/ file contents from that column through stored proc.
Can u please tell me how can i do that??
Thank you,
GautamExamine two packages, Dbms_Lob and Utl_File. You are building your file from clob 'piece-by-piece' until you reach the end of clob.
Pseudo
- open file for writing (utl_file)
- get the length of clob
- get first part of clob (dbms_lob.substr)
- apend part of clob (from previous) to the file
- while not end of clob repeat previous two steps -
Extract text file from a folder and read the content
Hi
I have "n" no.of text files saved in a folder with automatically generated naming convention which include DD/MM/YYYY and also some measurement output value.
Eg: 1) Die_1_DUT_outputvalue_DD_MM_YYYY.txt
2) Die_1_DUT_outputvalue_DD_MM_YYYY_ABC.txt
In the above files part of the 2nd file naming convention same as the first file (i.e. Die_1_DUT and DD_MM_YYYY) whereas outputvalue is different and an additional string named ABC is appended.
Now I want to search the 2nd file based on matching the naming pattern with the 1st file (note: the outputvalue in the file name is different for both files) and so far followed this method
1) Use a list folder with *.txt pattern to search all the text files and the output is a 1D array
2) then use array to cluster and then flatten to XML function to have all the text file names as a string element (not 1D array)
3) then pass the output of the 2nd step to the sting match pattern and use a regular expression to get the required file name
4) send the output of the 3rd step to search 1D array to get the index and then get the file name and later use read text file to read the content of the text file
And I am stuck at the 3rd step while sending an input as the regular expression to match the pattern as the outputvalue in the namming convention of the above two files is different is there any way I can actually extract the filename/file?
Any suggestions?
Attachments:
1.png 11 KBSome bits in your code are unnecessary, a leaner implementation here:
Beginner? Try LabVIEW Basics
Sharing bits of code? Try Snippets or LAVA Code Capture Tool
Have you tried Quick Drop?, Visit QD Community. -
How do I create multiple text files from a list in another file?
I have a text file with data in it:
1. Bristol
2. Bath
3. Exeter
etc
I want to run an action which outputs the following files:
1.txt (contents: 1 Bristol)
2.txt (contents: 2.Bath)
3.txt (contents: 3.Exeter)
I can't work ou how to do this, any help appreciated. Thanks
DaveHi mate, thanks for the suggestion. I saw that section in the user guide - but it is only for copying from one library to another - I want to copy from an FCP library to a file structure OUTSIDE FCP. I have had problems with FCP losing media when copying to another library so I just want the files in the Finder where I can see them...
Stephen -
Cannot load a RAW file from Nikon D7200 into Elements 9!
trying to open a RAW (NEF) file from my Nikon D7200 into Elements 9 (version 9.0.3) and I get the message that "cannot open because it is the wrong type of file". Can some one help me? I have the RAW 6.5 plug-in installed
Hi,
The D7200 requires Camera Raw 9.0 which is not compatible with PSE 9.
You either need to upgrade to PSE 13 or use the free Adobe DNG converter which can take the NEF files and convert them to DNG files. The DNG files can then be processed by PSE 9.
DNG Converter 9.0
Mac – http://www.adobe.com/support/downloads/detail.jsp?ftpID=5882
Win – http://www.adobe.com/support/downloads/detail.jsp?ftpID=5883
Useful Tutorial
http://www.youtube.com/watch?v=0bqGovpuih
This assumes that you are not on an old operating system which is not supported.
Brian -
I've got a game that has a folder with Saved Games (Okay, it's Minecraft). I don't always have my external drives because I take my Mac Mini from my house to my friend's house and of course back after we finish playing.
There are times where I want a back up so that if something happens we can restore it as easily as possible.
What I've been doing is copying the particular saved game and pasting it to my desktop, replacing the new backup over the old backup. I'd like to be able to create a "batch file" so that I can just double-click on it and it will copy and paste overwriting the old version.
Since this is being automated I've been thinking. It would be nice to have 10 backups which I would like to have numbered from 1 to 10 (and not 0 to 9).
I'd like the batch file to delete backup 10 then rename backup 9 to 10 and 8 to 9 and so forth until backup 1 becomes backup 2 and then my live copy then gets copied to my desktop. I guess that one really doesn't need a number after it. It can have the exact same name.
Don't worry about automating the restore. I just want the backup part of it automated. I'm not a UNIX guy but I've tried to figure it out and it is just not working. So ... if someone out there can reply with a solution for me that would be great.
Extra credit for automatically compressing the backups with the built in compression utility so my backups use less space.
Thanks in advance.I have another psd (adjustment_layer.psd) file that only has one layer, and it is an adjustment layer. .
That is possible. An adjustment layer must be over a layer. The layer that it is over can have its visibility off but there needs to at least two layers in your (adjustment_layer.psd) file. For you can not have and adjustment layer without a layer to adjust.
Are all your PSD file the same in size x px by y px at z DPI?
It would be easy to create an action just to add the adjustment layer you want if your (adjustment_layer.psd) file adjustment layer, layer mask is a reveal all or hide all mask. You can Batch the action or use the Image processor script and have it include your action that add the adjustment layer you do not need to write a script.
I would also record that action to add the adjustment layer clipped to the layer below. There is a bug in CS4 and CS5 Action Player. Actions that have recorded adding adjustment layers to be applied to all layers below may play incorrectly. You will have to pay to get a fix for this bug for Adobe is not going to apply a fix the the current releases of Photoshop. The bug is so far slated to be fixed in CS6 time will tell. -
Importing All the files from a folder at a time
Hi....
Can any body tell me how to import set of files from a folder into IDM.
It is becoming very difficult to import the files one after other....
Waiting for Reply....
Thanks in advance..........We used an ant script to build an XML file that will contain the files. The script is configured to use the folder structure of our CVS repository.
We'd checkout our XML module and then run the build script and import the resulting init file.
Code to the script is below -- caveat emptor. You'll need to change the folder structure to suit your own environment.
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="MyInit">
<target name="init">
<property location="." name="src.dir"/>
<property location="." name="dest.dir"/>
<property name="project.name" value="${ant.project.name}"/>
<property location="${dest.dir}/MyInit.xml" name="MyInit.output"/>
<property name="source.configuration" value="${dest.dir}/configuration"/>
<property name="source.emailTemplate" value="${dest.dir}/emailTemplate"/>
<property name="source.forms" value="${dest.dir}/forms"/>
<property name="source.reports" value="${dest.dir}/reports"/>
<property name="source.resource" value="${dest.dir}/resource"/>
<property name="source.rules" value="${dest.dir}/rules"/>
<property name="source.workflow" value="${dest.dir}/workflow"/>
<!-- get the source path -->
<path id="configuration.path">
<fileset dir="${source.configuration}" >
<include name="*.xml" />
</fileset>
</path>
<property name="cp" refid="configuration.path" />
<path id="emailTemplate.path">
<fileset dir="${source.emailTemplate}" >
<include name="*.xml" />
</fileset>
</path>
<property name="ep" refid="emailTemplate.path" />
<path id="forms.path">
<fileset dir="${source.forms}" >
<include name="*.xml" />
</fileset>
</path>
<property name="fp" refid="forms.path" />
<path id="reports.path">
<fileset dir="${source.reports}" >
<include name="*.xml" />
</fileset>
</path>
<property name="rptp" refid="reports.path" />
<path id="resource.path">
<fileset dir="${source.resource}" >
<include name="*.xml" />
</fileset>
</path>
<property name="rep" refid="resource.path" />
<path id="rules.path">
<fileset dir="${source.rules}" >
<include name="*.xml" />
</fileset>
</path>
<property name="rp" refid="rules.path" />
<path id="workflow.path">
<fileset dir="${source.workflow}" >
<include name="*.xml" />
</fileset>
</path>
<property name="wp" refid="workflow.path" />
<!-- get the path prefix -->
<path id="source.path">
<pathelement location="${src.dir}" />
</path>
<property name="sp" refid="source.path" />
</target>
<target depends="init" name="win_init">
<!-- change the path of xml files to windows path -->
<property name="importfile.path" value="${sp}"/>
</target>
<target depends="init" name="make">
<!-- using XML character entity references to escape
< <
> >
' ' -->
<echo file="${MyInit.output}" append="false"><?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Waveset PUBLIC 'waveset.dtd' 'waveset.dtd'>
<Waveset>
${cp}
${ep}
${fp}
${rptp}
${rp}
${wp}
</Waveset>
</echo>
<!-- replace path prefix with ImportCommand -->
<replace file="${MyInit.output}"
token = "${sp}"
value = "<ImportCommand name='include' file='${importfile.path}" />
<!-- deal with file and path separators in an os independent way -->
<replace file="${MyInit.output}"
token = "${file.separator}"
value = "/" />
<replace file="${MyInit.output}"
token = "${path.separator}"
value = "${line.separator}" />
<replace file="${MyInit.output}"
token = ".xml"
value = ".xml'/>" />
</target>
<target depends="init,win_init,clean,make" description="Build everything." name="all"/>
<target depends="init" description="Clean all build products." name="clean">
<delete file="${MyInit.output}"/>
</target>
</project>
Maybe you are looking for
-
Why Aperture doesn't send the RAW file to Photoshop
I've seen the complaint about Aperture not passing the original RAW file to Photoshop in several places in this forum. I think I have a reason for why Aperture doesn't work this way. The reason has to do with the 1st law of digital RAW photography. "
-
Why can\'t I get a report to print on Quicken
I have a new printer the HP officejet 6600 and it won't print a report from the Quicken 2011 Home & Business program. I could on our old HP officejet 6610.
-
Hello everybody, I need to crop and straighten a load of scanned rectangular stamps that will start as a single scanned image, and I want to lock the aspect ratio to 1:1, define the top border size (such that the the borders on the sides will be bigg
-
SAPSYS, Password logon no longer possible
I get an error info from log file dev_rfc0, it's "User: SAPSYS (Client: 000) Password logon no longer possible - too many failed attempts". Same error info can also be found in ST22, shown below: Runtime Errors: CALL_FUNCTION_REMOTE_ERROR Short text:
-
WebLogic to Websphere migration issues
Hi, We are migrating Java applications from BEA WebLogic 8.1 to WebSphere 6.1 as part of which we have come across few BEA WebLogice workshop specific files/features. It will be great if you could share your thoughts on possible solution/easy way of