How to automate loading data from a text file ?
Hi,
I need to load a data form a text file automatically. (for example: every day at 6.p.m) .
It is possible to use DBMS_SCHEDULER with SQL LOADER ? or maybe u have others idea ?
regards,
assuming that the text file resides at the machine where the database is installed at you can create a procedure that use the built-in UTL_FILE package to read and load the data to the oracle tables. then create a job that use the DBMS_JOB or DBMS_SCHEDULER to create an automated schedule to run the job that calls the procedure you have created.
or assuming that the text file resides or at the local/client machine (example c:\ drive) on a windows xp platform. create a batch file that do a ftp to transfer the text file to the oracle database server and create a schedule job using the windows scheduler. also create a procedure that use the built-in UTL_FILE package to read and load the data to the oracle tables. then create a job that use the DBMS_JOB or DBMS_SCHEDULER to create an automated schedule to run the job that calls the procedure you have created.
Similar Messages
-
How to do import data from the text file into the mathscript window?
Could anyone tell me how to do import data from text file into mathscript window for labview 8?
MathScript Window openned, File, Load Data - it has options: custom pattern (*.mlv) or all files.
ThanksHi Milan,
Prior to loading data in Mathscript Window , you have to save the data from the Mathscript window (the default extension of the file is .mlv but you can choose any extension). This means that you cannot load data from a text file that was not created using the Mathscript window.
Please let me know if you have any further questions regarding this issue.
Regards,
Ankita -
Error while loading data from a text file to a datastore
Hi all,
i am a starter in ODI. I am trying to load data from a text file into a datastore. I have put the file on a unix server whose location is defined in the topology manager. when i am trying to "view data" it is giving me error file does not exist at <location where i have put the file>. Please help meHi,
1. If your files are on a remote File System, you will need to copy one of your files to the machine ODI Designer is running on to allow ODI to retrieve the metadata information of the file.
2. In Topology create a Physical Schema, the directory you enter for Data and Work Schema should point at this local file.
3. Then define the File Datastore in ODI Designer. Enter a name, browse and select the file and fill in each filed of the Files tab.
* If its a Fixed file, click on the grid icon on the Columns tab to enter the columns and have Automatic Adjustment checked.
* If its a Delimited file, use the Reverse button on the Columns tab to reverse the columns.
* Right click on the File Datastore select View Data, if you can view data, that means the File Datastore has been defined correctly.
* If not, check each tab of the File Datastore to make sure everything is defined correctly and retry.
4. Once View Data is successful, you now change the directories (Data and Work Schema in Topology) to point at the remote File System. These directories must be accessible to the ODI Agent that will be used to run the transformations. The directory can be an absolute path (m:/public/data/files) or relative to the ODI Agent startup directory (../demo/files). It is strongly advised to use a UNC (independent from the execution location) for the path. When running the transformations with "no agent", the directory is relative to the directory where Oracle Data Integrator has been installed.
You need to have a agent process running at the system where your source file resides .
Then while running the odi interface choose that agent .
Thanks,
Sutirtha -
How do you read data from a text file into a JTextArea?
I'm working on a blogging program and I need to add data from a text file named messages.txt into a JTextArea named messages. How do I go about doing this?
Student_Coder wrote:
1) Read the file messages.txt into a String
2) Initialize messages with the String as the textSwing text components are designed to use Unix-style linefeeds (\n) as line separators. If the text file happens to use a different style, like DOS's carriage-return+linefeed (\r\n), it needs to be converted. The read() method does that, and it saves the info about the line separator style in the Document so the write() method can re-convert it.
lethalwire wrote:
They have 2 different ways of importing documents in this link:
http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html
Neither of those methods applies to JTextAreas. -
I would like to plott data from a text file in the same way as a media player does from a video file. I’m not sure how to create the pointer slide function. The vi could look something like the attached jpg.
Please, can some one help me?
Martin
Attachments:
Plotting from a text file like a media player example.jpg 61 KBHI Martin,
i am not realy sure what you want!?!?
i think you want to display only a part of the values you read from XYZ
so what you can do:
write all the values in an array.
the size of the array is the max. value of the slide bar
now you can select a part of the array (e.g. values from 100 to 200) and display this with a graph
the other option is to use the history function of the graphes
regards
timo -
Is there away to load data from a text file to a table?
I have data stored in filename.txt and I want to load those data into a table on the front pannel of vi. How can I do that?
Se;
If the text file is already in an spreadsheet format, you can download the VI Read Strings From Spreadsheet File from my website:
http://www.jyestudio.com/lview.shtml
It is the suggested modification of the VI Read From Spreadsheet File that comes with LabVIEW, as stated in the diagram.
If the text file is not in spreadsheet format, then you need to write your own code to make the string table suitable for the table.
Regards;
Enrique
www.vartortech.com -
PROBLEM LOADING DATA FROM A TEXT FILE.
Hi,
Im having a problem in loading my csv file to the database. Im using Oracle Database 10g for Linux. Im in p. 228 in the book. This is my csv file look.
db_name db_version host_id
db10 9.2.0.7 1
db11 10.2.0.1 1
db12 10.2.0.1 1
db13 9.2.0.7 1
db14 10.2.0.1 1
db15 9.2.0.7 1
I loaded this data to an existing table called DATABASES loaded from tab delimited. FILE CHARACTER SET is UNICODE UTF-8. Then I browsed the name of the csv file to be uploaded. It looked like this.
File Name F23757437/db2.csv Reupload File
Separator
Optionally Enclosed By
First row contains column names.
File Character Set
I CLICKED NEXT, THIS IS WHAT IT LOOKED LIKE.
Schema: HANDSONXE06
Table Name: DATABASES
Define Column Mapping
Column Names %
Format
Upload yes
Row 1 "db10" "9.2.0.7" 1
Row 2 "db11" "10.2.0.1" 1
Row 3 "db12" "10.2.0.1" 1
Row 4 "db13" "9.2.0.7" 1
Row 5 "db14" "10.2.0.1" 1
Row 6 "db15" "9.2.0.7" 1
I CLICKED LOAD AND THIS WAS THE RESULT.
* There are NOT NULL columns in HANDSONXE06.DATABASES. Select to upload the data without an error.
Schema
Down
Table Name
Down
File Details
Down
Column Mapping
Load Data
Schema: HANDSONXE06
Table Name: DATABASES
Define Column Mapping
Column Names COLUMN_NAMES
Format FORMAT
Upload UPLOAD
Row 1 "db10" "9.2.0.7" 1
Row 2 "db11" "10.2.0.1" 1
Row 3 "db12" "10.2.0.1" 1
Row 4 "db13" "9.2.0.7" 1
Row 5 "db14" "10.2.0.1" 1
Row 6 "db15" "9.2.0.7" 1
I WAS REALLY WONDERING WHAT WAS REALLY WRONG. AN ERROR MESSAGE SAID, THERE ARE NOT NULL COLUMNS IN THE HANDSONXE06.DATABASES. I DIDN'T KNOW HOW TO FIX IT. WHAT DO I NEED TO CHANGE TO LOAD THE DATA WITHOUT AN ERROR? IT REALLY CONFUSED ME A LOT AND HOW COME I HAVE AN ERROR? PLEASE HELP ME. I NEED AND ANSWER TO MY PROBLEM PLEASE. I CANNOT GO FORWARD BECAUSE OF THIS.
THANKS,
JOCELYNI'm not certain of the utility you are using to load the data, however, I completed the following test using SQL Loader to insert the data into my table. Your process should work similar if the trigger and sequence are created for the table you are loading.
SQL> create table load_tbl
2 (db_id number(3) not null,
3 db_name varchar2(100) not null,
4 db_version varchar2(25),
5 host_id number(3) not null)
6 /
Table created.
SQL> desc load_tbl
Name Null? Type
DB_ID NOT NULL NUMBER(3)
DB_NAME NOT NULL VARCHAR2(100)
DB_VERSION VARCHAR2(25)
HOST_ID NOT NULL NUMBER(3)
SQL> create sequence db_id_seq;
Sequence created.
SQL> create or replace trigger db_id_trig
2 before insert on load_tbl
3 for each row
4 when (new.db_id is null)
5 begin
6 select db_id_seq.nextval into :new.db_id from dual;
7 end;
8 /
Trigger created.
The contents of the data file, control file and log file are below for the load into load_tbl.
C:\>sqlldr userid=username/password@db control=db_id_load.ctl log=db_id_load.log
SQL*Loader: Release 9.2.0.6.0 - Production on Thu Jan 18 17:21:47 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Commit point reached - logical record count 6
C:\>
SQL> select * from load_tbl
2 /
DB_ID DB_NAME DB_VERSION HOST_ID
1 db10 9.2.0.7 1
2 db11 10.2.0.1 1
3 db12 10.2.0.1 1
4 db13 9.2.0.7 1
5 db14 10.2.0.1 1
6 db15 9.2.0.7 1
6 rows selected.
SQL>
Data File"db10" "9.2.0.7" 1
"db11" "10.2.0.1" 1
"db12" "10.2.0.1" 1
"db13" "9.2.0.7" 1
"db14" "10.2.0.1" 1
"db15" "9.2.0.7" 1
Control FileLOAD DATA
INFILE "C:\db_id_load.dat"
APPEND INTO TABLE load_tbl
FIELDS TERMINATED BY WHITESPACE OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(db_name CHAR,
db_version CHAR,
host_id "TO_NUMBER(:host_id,'99999999999')"
Log FileSQL*Loader: Release 9.2.0.6.0 - Production on Thu Jan 18 17:21:47 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Control File: db_id_load.ctl
Data File: C:\db_id_load.dat
Bad File: db_id_load.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table LOAD_TBL, loaded from every logical record.
Insert option in effect for this table: APPEND
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
DB_NAME FIRST * WHT O(") CHARACTER
DB_VERSION NEXT * WHT O(") CHARACTER
HOST_ID NEXT * WHT O(") CHARACTER
SQL string for column : "TO_NUMBER(:host_id,'99999999999')"
Table LOAD_TBL:
6 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Space allocated for bind array: 49536 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 6
Total logical records rejected: 0
Total logical records discarded: 0
Run began on Thu Jan 18 17:21:47 2007
Run ended on Thu Jan 18 17:21:47 2007
Elapsed time was: 00:00:00.39
CPU time was: 00:00:00.13 -
I have a text file in a data archive that contains various information (numeric and string) that I need to load into different controls in a VI would I have to open the file and look for certain characters to begin and end loading? The information was previously stored by the VI from the control so can I simply load a previous set of data by using it's data path and control file name?
Solved!
Go to Solution.I assume that the numbers following the "OH data is listed below:" is supposed to go into a 2D array?
There are several ways to do this. One simple way is to simply read the file and chop off each section of interest, and converting the string to a 2D array, like this:
Another is to read the file in using the Read From Spreadsheet File, and then indexing out the first column, and use that to search for the indices where the regions of interest lie. You can then use Array Subset to get the 2D array of data.
Message Edited by smercurio_fc on 07-22-2009 02:56 PM
Attachments:
Example_VI.png 15 KB -
How to retrieve specific data from a text file
Hi, everyone
For my project it is required that a parameter file is read at the beginning, in order for certain variables to be initialized with specific values that change with the user.
At the moment, the way it is done is the following: The values at a specified sequence in a text file are read and saved in an array and the elements of the array are retrieved according to their index.
The problem with this implementation is, that if for some reason the format of the file changes, e.g. we want to use a parameter file from a previous version of the program that has the values for the same variables but in a different order, the only way to have the right values for the parameters is to change everything accordingly, which is really time wasting.
Could someone suggest a different implementation that would make the reading of the different values independent from their order in the file, e.g. by scanning the file for specific strings and reading the value after the string?
Thank you very much.
P.S. I have attached a screenshot of the routine I am using now.
Solved!
Go to Solution.
Attachments:
read parameter file.JPG 180 KBHi panagiov,
Find attached Folders.
Method 1: in this you can search for each variable separately. You can use "Config file vis" to get all keys(Variables) at once and then you can use for loop to get their values. Or you can access individual values as shown in this code.
Method 2: here you will get all data at once. You will get Variable and Data (2D array) You need to search variables as and when required.
I hope you will understand these methods.
Best of luck
Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
Attachments:
Method 1.zip 7 KB
Method 2.zip 9 KB -
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 -
How to to load data from a flat file in selection screen in portal .
Dear All,
I have a question to share : In BEX analyzer i know how i can upload multiple data in selection screen through a flat file , for example if i have to load 200 materials at one go in the selection screen, i can do that in BEX Analyzer . But if i run the same report through portal i am not able to find the upload option through flat file ..... Am i missing some option here ?
Thanks & Regards,
Ashutosh SinghYou will not be able to load through the portal directly. it is possible to load if you can create Visual composer model. that also you will not be able to upload in bulk.
-
How to load Test data from a Text file in ECATT
Hi,
I have created a test configuration with a test script, system data container, and test data container.
I have done the recording of a transaction and created the script. Parameterization is done for the script and have imported those parameters from script in to the data container.
I am trying to load a the data from a text file on the local work-station. The data is not being read.
Please explain this in detail (step by step) as I am very new to ECATT.
I am trying this on SAP ECC 6.0 IDES server.
Thanks in Advance
Vikas PatilPlease explain this in detail (step by step) as I am very new to ECATT.
Thanks in Advance
Vikas Patil -
How to regularly load data from .csv file to database (using apex)
Hi,
i am using apex3 , I need to load data from a csv file to apex . I need to perform this automatically through code at regular time interval of 5-10 seconds.
Is it possible .If yes how ?. Please reply as early as possible. This will decide whether to use apex or not for this application.
this is question for Application Express. Dont know why in forum for BPEL
Edited by: TEJU on Oct 24, 2008 2:57 PMHello,
You really need to load the data every 5-10 seconds? Presumably it's read only?
I would look at using an Oracle external table instead, that way you just drop your CSV in a location the DB can read it and then you build a table that essentially references the underlying CSV (that way when you query the table you view the data in the CSV file).
Take a look at this link for a quick example on usage -
http://www.oracle-base.com/articles/9i/SQLNewFeatures9i.php#ExternalTables
Hope this helps,
John.
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! -
How can I use Automator to extract specific Data from a text file?
I have several hundred text files that contain a bunch of information. I only need six values from each file and ideally I need them as columns in an excel file.
How can I use Automator to extract specific Data from the text files and either create a new text file or excel file with the info? I have looked all over but can't find a solution. If anyone could please help I would be eternally grateful!!! If there is another, better solution than automator, please let me know!
Example of File Contents:
Link Time =
DD/MMM/YYYY
Random
Text
161 179
bytes of CODE memory (+ 68 range fill )
16 789
bytes of DATA memory (+ 59 absolute )
1 875
bytes of XDATA memory (+ 1 855 absolute )
90 783
bytes of FARCODE memory
What I would like to have as a final file:
EXCEL COLUMN1
Column 2
Column3
Column4
Column5
Column6
MM/DD/YYYY
filename1
161179
16789
1875
90783
MM/DD/YYYY
filename2
xxxxxx
xxxxx
xxxx
xxxxx
MM/DD/YYYY
filename3
xxxxxx
xxxxx
xxxx
xxxxx
Is this possible? I can't imagine having to go through each and every file one by one. Please help!!!Hello
You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
if f ends with "/" then set f to f's text 1 thru -2
do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
use strict;
use open IN => ':crlf';
chdir $ARGV[0] or die qq($!);
local $/ = qq(\\0);
my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
local $/ = qq(\\n);
# CSV spec
# - record separator is CRLF
# - field separator is comma
# - every field is quoted
# - text encoding is UTF-8
local $\\ = qq(\\015\\012); # CRLF
local $, = qq(,); # COMMA
# print column header row
my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
# print data row per each file
while (@ff) {
my $f = shift @ff; # file path
if ( ! open(IN, '<', $f) ) {
warn qq(Failed to open $f: $!);
next;
$f =~ s%^.*/%%og; # file name
@dd = ('', $f, '', '', '', '');
while (<IN>) {
chomp;
$dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
last unless grep { /^$/ } @dd;
close IN;
print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
EOF
Hope this may help,
H -
How to load data from a flat file which is there in the application server
HI All,
how to load data from a flat file which is there in the application server..Hi,
Firstly you will need to place the file(s) in the AL11 path. Then in your infopackage in "Extraction" tab you need to select "Application Server" option. Then you need to specify the path as well as the exact file you want to load by using the browsing button.
If your file name keeps changing on a daily basis i.e. name_ddmmyyyy.csv, then in the Extraction tab you have the option to write an ABAP routine that generates the file name. Here you will need to append sy-datum to "name" and then append ".csv" to generate complete filename.
Please let me know if this is helpful or if you need any more inputs.
Thanks & Regards,
Nishant Tatkar.
Maybe you are looking for
-
Complete novice at this have just got myself a Mini tring to use it as a media center with a Sony Bravia KDL S40A12U. Have read about the problems using the two together and tried an app called DisplayconfigX. Tweaked the resolution and installed res
-
Cannot find the Remote button in iTunes
A have an iPhone 5S and a MacBook Pro and have tried several times this year to set up the Remote app to no avail. I have read all the discussion posts regarding fixing this issue but still cannot generate the elusive Remote button. At this moment I
-
Please help : connection in the LAN
hello every one ... I have a Lan network .. i want to enter another PC by using JAVA ... I Know the User Name and the password ... so how can i do that ... please help ... best regards
-
Hi, Please provide a solution for the below problem. "If the difference between current system date(timestamp) and the most recent date available in a table(the table has timestamp as one of the column) is greater than 2 years,then the table should b
-
LR 2.1 Plugin Manager not saving my plugins
I use Jeffrey friedl's smugmug plug in for exporting. never had a problem in the past with it. Now light room plug in manager is not saving the plugin. I have to add it into lr every time I go to use it. I close out of LR and then its gone. I have tr