Dynamic Resource name for Excel/csv files
Hi All,
Reading from a source excel (as well as csv) file, I tried passing the resource name via a variable which is set to contain the name of the file (refresh). However, on execution, the file name shows up with an additional "\" character without being specified in the variable text causing the interface to face on load step.
The error says:
ODI-1227: Task SrcSet0 (Loading) fails on the source FILE connection <ConnNameHere>.
Caused By: java.sql.SQLException: ODI-40438: File not found: C:\DirectoryNameHere\ /OTD.
Is this expected behavior where one needs to escape the special character?
I've verified that the extra / is not present in either the variable value or the directory for the Physical Schema.
TIA.
http://youtu.be/-QMV6cElgsk
http://youtu.be/V7OzzZ3kYdc
http://youtu.be/hNqqbZ4sJWA
http://youtu.be/TMHzhtEwgrA
http://youtu.be/REJDi584jh8
http://youtu.be/jE6k5OfWqi0
http://youtu.be/P3EKyykseps
http://youtu.be/-QMV6cElgsk
http://youtu.be/Gl7YvZohVVA
http://youtu.be/zb1ue5BP9mI
http://youtu.be/NhPDcc8n4VU
http://youtu.be/tD_kw5QXmps
Similar Messages
-
Import data from excel/csv file in web dynpro
Hi All,
I need to populate a WD table by first importing a excel/CSV file thru web dynpro screen and then reading thru the file.Am using FileUpload element from NW04s.
How can I read/import data from excel / csv file in web dynpro table context?
Any help is appreciated.
Thanks a lot
AakashHi,
Here are the basic steps needed to read data from excel spreadsheet using the Java Excel API(jExcel API).
jExcel API can read a spreadsheet from a file stored on the local file system or from some input stream, ideally the following should be the steps while reading:
Create a workbook from a file on the local file system, as illustrated in the following code fragment:
import java.io.File;
import java.util.Date;
import jxl.*;
Workbook workbook = Workbook.getWorkbook(new File("test.xls"));
On getting access to the worksheet, once can use the following code piece to access individual sheets. These are zero indexed - the first sheet being 0, the second sheet being 1, and so on. (You can also use the API to retrieve a sheet by name).
Sheet sheet = workbook.getSheet(0);
After getting the sheet, you can retrieve the cell's contents as a string by using the convenience method getContents(). In the example code below, A1 is a text cell, B2 is numerical value and C2 is a date. The contents of these cells may be accessed as follows
Cell a1 = sheet.getCell(0,0);
Cell b2 = sheet.getCell(1,1);
Cell c2 = sheet.getCell(2,1);
String a1 = a1.getContents();
String b2 = b2.getContents();
String c2 = c2.getContents();
// perform operations on strings
However in case we need to access the cell's contents as the exact data type ie. as a numerical value or as a date, then the retrieved Cell must be cast to the correct type and the appropriate methods called. The code piece given below illustrates how JExcelApi may be used to retrieve a genuine java double and java.util.Date object from an Excel spreadsheet. For completeness the label is also cast to it's correct type. The code snippet also illustrates how to verify that cell is of the expected type - this can be useful when performing validations on the spreadsheet for presence of correct datatypes in the spreadsheet.
String a1 = null;
Double b2 = 0;
Date c2 = null;
Cell a1 = sheet.getCell(0,0);
Cell b2 = sheet.getCell(1,1);
Cell c2 = sheet.getCell(2,1);
if (a1.getType() == CellType.LABEL)
LabelCell lc = (LabelCell) a1;
stringa1 = lc.getString();
if (b2.getType() == CellType.NUMBER)
NumberCell nc = (NumberCell) b2;
numberb2 = nc.getValue();
if (c2.getType() == CellType.DATE)
DateCell dc = (DateCell) c2;
datec2 = dc.getDate();
// operate on dates and doubles
It is recommended to, use the close() method (as in the code piece below) when you are done with processing all the cells.This frees up any allocated memory used when reading spreadsheets and is particularly important when reading large spreadsheets.
// Finished - close the workbook and free up memory
workbook.close();
The API class files are availble in the 'jxl.jar', which is available for download.
Regards
Raghu -
Assign Logical file name for the physical file path through Program
Hi all,
I am having a physical file which is getting generated dynamically. It is having the date and time stamp in its name which is added at runtime.
Now I need to assign a logical file name for the physical file path through the program.
Is there any FM or any other method to assign the same.
GauravI think it is not possible. becuase the date & time added at runtime. so if you check the table PATH you can find filename and their definitions
a® -
Hi All,
Could JDBC API read off values from an excell csv file? Such that they could be transferred easily to JTables? Thanx again ^^you could configure the "Microsoft Text Driver" (which is for CSV and text files), from 32-bit ODBC option of control panel in Windows Systems (if u r using windows).
Then u can query using normal JDBC SQL syntax,
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:myDsn");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from myCsvFile.csv");
Priya. -
Creating a header for a .CSV file
Hi,
I have looked through the forums and cannot find a solution for creating a header for a csv file. I am using Labview 8.2. I want a label for each column at the top of the file and then I will append new rows to the file as the data is collected. An example of what I am looking for is attached.
It would also be nice to have the labels descending in the first column, pretty much a transposed version of what was described above.
Thanks,
Gary
Solved!
Go to Solution.
Attachments:
exampleLOG.csv 1 KBThank you very much. That worked well.
If i wanted to transpose the data how would I do that? I can get the header to be vertical, but I cant get the data to append to the 2nd column , and then the third and so on with the data descending from top to bottom. I attached an example of what I might want the file to look like. Each column would be added one at a time.
Attachments:
data3.csv 1 KB -
Which version of the Forms Central subscription will allow me to export data to excel (CSV file)?
Hi Heather 349
I believe you can do it with both FormsCentral Basic and FormsCentral PLUS
Also Refer : Tutorial: Exporting Responses to Excel, CSV or PDF -
Package name for Toplink generated file
Is there is way to specify a package name for the java file generated when you export a project.
Thanks,
RajivYes, select the project in the mapping workbench, click on the "Defaults" tab.
There's a checkbox called "Specify Project Package".
Darren
Is there is way to specify a package name for the java file generated when you export a project.
Thanks,
Rajiv -
Error: is an invalid name for a book file
Hi everyone,
I'm trying to export about 20 files to pdf from a books panel, but when I try this the program just hangs. When I open up the book panel I get the following error:
"is an invalid name for a book file"
I wondered if anyone has come across this error before or knows what it means? I tried to create a new book and reinsert the files but I'm still getting the same problem when I try to go to pdf.
Really appreciate any advice.Sorry to come back to this - I've tried both suggestions but it hasn't fixed the problem. I've tried though to open up individual chapter files and export to pdf but the odd thing is that when I export these individual files to pdf interactive they work fine but when I export to a print pdf the program crashes. Each of the files have a heap of cross-references within them so I don't know if that's contributing to the problem, but even so when I export to print pdf, I don't check off bookmarks and hyperlinks and it still crashes. In fact I even made a copy of one of the files and deleted all the cross-references and then tried again to export to print-pdf but it still crashed.
I even exported one of the chapters to the .idml file format and then re-opened it up and saved it. I then exported to print-pdf and it crash again.
The only method that seems to work is when I don't open a file, ie. I just select it from within the books panel, I then export that single chapter to print-pdf and I make sure "bookmarks" and "hyperlinks" are uncheck. If I do it this, I can successfully export a print pdt without it crashing. The strange thing though is that if I open that chapter up and export it in the same way, then ID crashes. It doesn't make sense.
I just don't know how to troubleshoot further. Does anyone have any further tips or advice that I can try?
Appreciate any further help. -
VBscript to export local outlook machine's GAL to excel CSV file
Hi,
Any one help to provide me VBscript to do Export GAL to excel CSV file in Local outlook system?
Windows OS - 7
Outlook version -2010 client
MDVBscript related questions should be posted in the developers forum:
https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=outlookdev
-Jeff -
C Programming: How can we get the filesystem name for a given file-path?
C Programming: How can we get the filesystem name for a given file-path?
Say I have a filepath=/mnt1/file1
Using some OS API like stat, can I get the Filesystem /mnt ?
Thanks in advance,
-VEnter the command up to the point of entering the file path and add a space, then drag the file into the terminal window. It will fill out the path.
If you need to go further into the contents of the Application package, you can continue with /Contents...
Another way is to start typing and then hit Tab to auto-complete. It will stop where it can't determine the next letter.
So, type /App tab and it will fill in /Applications. Type a / and start with the name of the app, then tab and it should complete. Continue till you have the correct path.
Spaces will be replaced with \<space>, so, App Store would end up as /Applications/App\ Store.app -
Dynamic File name for Open Hub file
Hi All,
I wanted to create a .csv file using open hub destination. I wanted the name of the file to be dynamic based on month. for example in jan I wanted it as 01.Dump for January and 02.Dump for february.
is is possible at all to do that.I wanted to save the file in the application server. There should not be any manual intervention the process.
Thanks in advance.
Regds
RaghuHi
We have take month from the first record that we read.
Our requirement is to take one months data and give it in a file with a file name having the corresponding month.
In the code mentioned below MOC_CODE is the field that is used for this purpose.
Hope it helps.
Regards,
Raghu
code:
#!/bin/sh
Script to dump file.
Parameters.
$1 Division name to extract from the data file.
It re-arranges the columns.
It replaces values in strings.
Parameters.
DATA_FILE_NAME="data_file.csv"
HEADER_FILE_NAME="header_file.csv"
DIVISION_NAME="$1"
Re-arrange header file columns.
Transpose rows to columns comma separated.
HEADER_ROW=`cat "$
Re-arrange header columns.
Re-direct the output to a temporary file.
" | tr '\n' ',' | sed 's/,$//g'`
echo "$" | awk 'BEGIN { FS = ","; OFS = "," } { print $2, $3, $1, $4, $5, $6, $7 }' > "$.$.tmp"
Prepare awk program.
Re-arrange data file columns.
Replace UNI in 6th column with UNIT and Replace TON in 6th column with TONS.
Filter division rows.
AWK_PROGRAM="BEGIN { FS = \",\"; OFS = \",\"; TVAL = 0 } \$5 ~ /$/ { sub( \"UNI\", \"UNIT\", \$6 ); sub( \"TON\", \"TONS\", \$6 ); print \$2, \$3, \$1, \$4, \$5, \$6, \$7; TVAL = TVAL + \$7 } END { printf \"$ Total Value: %f\", TVAL 2> \"$$Re-direct the program to a temporary program file.Control.ctl\" }"
echo "$" > "$.awk"
Execute the data file formatting command.
awk -f "$.awk" "$" > "$.$
Get generation date.
Get moc code from data file.
.tmp"
GENERATION_TIME=`date +"%Y%m%d_%H%M%S"`
MOC_CODE=`head -1 $ | awk -F, '{ print $3 }'`
Prepare dump file.
DUMP_FILE_NAME="$_$_$_$"
cat "$.$.tmp" "$.$.tmp" > "$
Remove temporary files.
FTP dump file to remote server.
FTP.
rm *.tmp
REMOTE_SERVER="<replace with server ip address>"
REMOTE_USER="xxxx"
REMOTE_PWD="xxxx"
ftp -n "$" << EOF
quote USER "$"
quote PASS "$"
ascii
put "$"
bye
EOF
Exit.
exit 0 -
Custom dynamic names for outbound payment files in R12
I have asked this on a couple of forums, but somehow missed this one.
We are upgrading from 11i to R12 and require custom dynamic file names for the Payments output files (cheques, advices, efts). I see that you can create a custom prefix and extension through payment profiles, but the functionality is very limited (i.e. no date stamp). I am thinking that others must have come across this before, and am wondering how you have handled such a requirement. Is it possible to add custom steps to the seeded payment process? Can the payment process be run as part of a request set and then a custom step added which grabs the output file and renames it based on information obtained from the batch and the process profile. Our goal is a fully automated payment process where batches are scheduled, processed and files renamed and sent out to banks and a 3rd party printer with no user interventation.
Any advice/tips would be appreciated.
Thanks.
Tam.Hi Tam,
Could you please let me know if you got the solution as we have a similar requirement of renaming the output file as perthe business needs fro which we need custom program.
Thanks,
Manas -
Newbie: BW Export to Excel/CSV file destination and file name
Is it possible to control where the export of a BW web query is sent by appending the url with some tag voodoo? Also, can I create the file name of the exported file? I figured out how to kick off the export process, but haven't found any code to control the export destination or file name. I wish to skip over the save dialog and write the file to a specific location.
Hello John,
BW provides several ways to export data. Please look into Open Hub for example.
Other options include Information Broadcasting in SAP NetWeaver '04 or MDX, XML Webservices, or OLAP BAPI.
Regards,
Marc
SAP NetWeaver RIG, US BI -
How to load excel-csv file into oracle database
Hi
I wanted to load excel file with csv extension(named as trial.csv) into
oracle database table(named as dept),I have given below my experiment here.
I am getting the following error,how should I rectify this?
For ID column I have defined as number(5) datatype, in my control file I have defined as interger external(5),where as in the Error log file why the datatype for ID column is comming as character?
1)my oracle database table is
SQL> desc dept;
Name Null? Type
ID NUMBER(5)
DNAME CHAR(20)
2)my data file is(trial.csv)
ID DNAME
11 production
22 purchase
33 inspection
3)my control file is(trial.ctl)
LOAD DATA
INFILE 'trial.csv'
BADFILE 'trial.bad'
DISCARDFILE 'trial.dsc'
APPEND
INTO TABLE dept
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(ID POSITION(1:5) INTEGER EXTERNAL(5)
NULLIF ID=BLANKS,
DNAME POSITION(6:25) CHAR
NULLIF DNAME=BLANKS
3)my syntax on cmd prompt is
c:\>sqlldr scott/tiger@xxx control=trial.ctl direct=true;
Load completed - logical record count 21.
4)my log file error message is
Column Name Position Len Term Encl Datatype
ID 1:5 5 , O(") CHARACTER
NULL if ID = BLANKS
DNAME 6:25 20 , O(") CHARACTER
NULL if DNAME = BLANKS
Record 1: Rejected - Error on table DEPT, column ID.
ORA-01722: invalid number
Record 21: Rejected - Error on table DEPT, column ID.
ORA-01722: invalid number
Table DEPT:
0 Rows successfully loaded.
21 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.
Bind array size not used in direct path.
Column array rows : 5000
Stream buffer bytes: 256000
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 21
Total logical records rejected: 21
Total logical records discarded: 0
Total stream buffers loaded by SQL*Loader main thread: 0
Total stream buffers loaded by SQL*Loader load thread: 0
5)Result
SQL> select * from dept;
no rows selected
by
balamuralikrishnan.sHi everyone!
The following are the steps to load a excell sheet to oracle table.i tried to be as simple as possible.
thanks
Step # 1
Prapare a data file (excel sheet) that would be uploaded to oracle table.
"Save As" a excel sheet to ".csv" (comma seperated values) format.
Then save as to " .dat " file.
e.g datafile.bat
1,Category Wise Consumption Summary,Expected Receipts Report
2,Category Wise Receipts Summary,Forecast Detail Report
3,Current Stock List Category Wise,Forecast rule listing
4,Daily Production Report,Freight carrier listing
5,Daily Transactions Report,Inventory Value Report
Step # 2
Prapare a control file that define the data file to be loaded ,columns seperation value,name and type of the table columns to which data is to be loaded.The control file extension should be " .ctl " !
e.g i want to load the data into tasks table ,from the datafile.dat file and having controlfile.ctl control file.
SQL> desc tasks;
Name Null? Type
TASK_ID NOT NULL NUMBER(14)
TASK_NAME VARCHAR2(120)
TASK_CODE VARCHAR2(120)
: controlfile.ctl
LOAD DATA
INFILE 'e:\datafile.dat'
INTO TABLE tasks
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(TASK_ID INTEGER EXTERNAL,
TASK_NAME CHAR,
TASK_CODE CHAR)
The above is the structure for a control file.
Step # 3
the final step is to give the sqlldr command to execute the process.
sqlldr userid=scott/tiger@abc control=e:\controlfile.ctl log=e:\logfile.log
Message was edited by:
user578762 -
Dynamic Resource Name in DataStore
Hi,
I have situation like this, i need to generate dynamic filename based on the input date passed. For example i have package with following steps
1. inputDate - inputParameter to the interface
2.vFileName - name of the output file generated by the Interface
3. Interface - business logic interface
The Target Data Store for interface is GENERIC_FILE_TEST. The output file needs to be changed based on input date.
May be i could use evaluate variable. Not sure about the right syntax.
Theoritically the logic would
be
if(inputDate=xx)
vFilename==zzz;
else
vFileName=vvcv;
and then use vFileName in resource name field of Target Data Store.
Appreciate providing correct syntax/technique.
ThanksHi,
let me suggest something....
1 - at package, receive the parameter in the variable (named inputDate for instance)
2 - write an sql query that solves what you need, like, in a oracle example: (the variable refers to itself)
select case when #inputDate=xx
then zzz
else vvcv
end
from dual
3 - after the step 1 at package, just add the variable again in refresh mode
4 - execute the interface.
Make any sense?
Cezar Santos
http://odiexperts.com
Maybe you are looking for
-
Cant see my airplay even after swipe up
I havnt been able to see my airplay icon when I tried to mirror my IPad Air on to the T.V. . I went a purchased a HDMI Adapter for 53$ Apple brand because all I want to do is mirror, no movies and music, just for work and nothing pops up, even swipe
-
MAC iPod video converting program (that does more than one at a time?)
hey i am trying to find a free or paid for program that will convert my videos for my ipod for mac. i have the mpeg streamclip but it only does one video at a time and i have about 600 music videos i'm trying to do. any input? thanks
-
Question on Using thunderbolt iMac as external display with a Macbook Air
If I connect my macbook air to new thunderbolt iMac - can I access peripherals attached to usb, firewire, ethernet like the thunderbolt 27"? if so how can i do this? thanks! Derrick
-
Output of spool command?
Where will the output of the "spool filename.out" command go if I do not supply a full path name? If I'm executing my PL/SQL script in iSQL, it goes into the directory I was in when I started up iSQL. When I'm using SQL Developer, it never shows up a
-
I was getting this error on an older windows xp pro machine and now it is appearing on a brand new windows 7 professional machine. I have confirmed the most up to date version of Java.