Comma Delimited Flat File
I have a comma delimited flat file. For example - "This,is,a,test" I want to read each word and perform something with the word in Business Logic Services. What is the best way to accomplish this?
In Business Logic, expand the XML Functions tab.
At the bottom you will see an action called: String List To Xml Parse
Use that action to parse the comma seperated items and then perform any logic required on the individual items.
What this action does is it places all the items in a Rowset/Row, Row, Row type format common to xMII.
Enjoy!
Note: If this was helpful please award points
Similar Messages
-
Creating a comma delimited flat file
Hi,
I am trying to create comma delimited flat files from oracle large Oracle 8.0.6 tables. What is the best method? It seems like using the spool command is very inefficiant. Can sqldr be used?Todd,
This looks very helpful -- thanks! I need to unload very large tables and this should do the trick.
Jeremiah -
Unable to upload delimited flat file (Datastore)
Dear All,
Drilling down the tutorial: ODI11g: Creating an ODI Project and Interface: Exporting a Flat File to a Flat File
facing quite a problem while reverse-engineering delimited flat file (Datastore ->Model). No matter which type of delimited flat file is uploaded (txt, csv,prn), the system stayes intact while pressing "Reverse Engineering" button. Changing to Fixed Flat File option reveals that the system uploads correctly only the first row - Header of the columns (second option from the top)..and ...of cource, all the rest of the rows were placed in the first column.
I was preparing delimited flat files using Excel 2007 and 2010, in both cases no success. I tryied to create Fixed Flat File with Excel....confused completely since I could not realise how doing that?!
Properties are below. Please, help!
About
Oracle Data Integrator 11g 11.1.1
Standalone Edition Version 11.1.1
Build ODI_11.1.1.6.0_GENERIC_111219.1055
Copyright (c) 1997, 2011 Oracle. All Rights Reserved.
IDE Version: 11.1.1.6.38.61.92
Product ID: oracle.odi
Product Version: 11.1.1.6.0.0.0
Version
Component Version
========= =======
Java(TM) Platform 1.6.0_21
Oracle IDE 11.1.1.6.0
Properties
Name Value
==== =====
awt.toolkit sun.awt.windows.WToolkit
class.load.environment oracle.ide.boot.IdeClassLoadEnvironment
class.load.log.level CONFIG
class.transfer delegate
eclipselink.xml.platform org.eclipse.persistence.platform.xml.jaxp.JAXPPlatform
file.encoding Cp1251
file.encoding.pkg sun.io
file.separator \
ice.browser.forcegc false
ice.pilots.html4.ignoreNonGenericFonts true
ice.pilots.html4.tileOptThreshold 0
ide.AssertCheckingDisabled true
ide.AssertTracingDisabled true
ide.bootstrap.start 14794412430839
ide.build ODI_11.1.1.6.0_GENERIC_111219.1055
ide.conf C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\odi\bin\odi.conf
ide.config_pathname C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\odi\bin\odi.conf
ide.debugbuild false
ide.devbuild false
ide.extension.search.path jdev/extensions
ide.firstrun true
ide.java.minversion 1.6.0_04
ide.launcherProcessId 2932
ide.main.class oracle.ide.boot.IdeLauncher
ide.patches.dir ide/lib/patches
ide.pref.dir C:\Users\Администратор\AppData\Roaming\odi
ide.pref.dir.base C:\Users\Администратор\AppData\Roaming
ide.product oracle.odi
ide.shell.enableFileTypeAssociation C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\odi64.exe
ide.splash.screen splash.gif
ide.startingArg0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\odi64.exe
ide.startingcwd C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client
ide.user.dir C:\Users\Администратор\AppData\Roaming\odi
ide.user.dir.var IDE_USER_DIR
ide.work.dir C:\Users\Администратор\Documents\odi
ide.work.dir.base C:\Users\Администратор\Documents
ilog.propagatesPropertyEditors false
java.awt.graphicsenv sun.awt.Win32GraphicsEnvironment
java.awt.printerjob sun.awt.windows.WPrinterJob
java.class.path ..\..\ide\lib\ide-boot.jar;..\..\..\..\oracledi.sdk\lib\ojdl.jar;..\..\..\..\oracledi.sdk\lib\dms.jar;..\..\jdev\extensions\oracle.odi.navigator\lib\log4j-1.2.8.jar;..\..\jdev\extensions\oracle.odi.navigator\lib\odi_hfm.jar;..\..\jdev\extensions\oracle.odi.navigator\lib\odihapp_common.jar;..\..\jdev\extensions\oracle.odi.navigator\lib\ess_es_server.jar;..\..\jdev\extensions\oracle.odi.navigator\lib\ess_japi.jar;..\..\jdev\extensions\oracle.odi.navigator\lib\odihapp_essbase.jar;..\..\jdev\extensions\oracle.odi.navigator\lib\odihapp_planning.jar
java.class.version 50.0
java.endorsed.dirs C:\Java\jre\lib\endorsed
java.ext.dirs C:\Java\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
java.home C:\Java\jre
java.io.tmpdir c:\Temp\
java.library.path C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\app\master\product\11.2.0\dbhome_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
java.naming.factory.initial oracle.javatools.jndi.LocalInitialContextFactory
java.protocol.handler.pkgs null|oracle.odi.ui.url
java.runtime.name Java(TM) SE Runtime Environment
java.runtime.version 1.6.0_21-b07
java.specification.name Java Platform API Specification
java.specification.vendor Sun Microsystems Inc.
java.specification.version 1.6
java.util.logging.config.class oracle.core.ojdl.logging.LoggingConfiguration
java.vendor Sun Microsystems Inc.
java.vendor.url http://java.sun.com/
java.vendor.url.bug http://java.sun.com/cgi-bin/bugreport.cgi
java.version 1.6.0_21
java.vm.info mixed mode
java.vm.name Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name Java Virtual Machine Specification
java.vm.specification.vendor Sun Microsystems Inc.
java.vm.specification.version 1.0
java.vm.vendor Sun Microsystems Inc.
java.vm.version 17.0-b17
line.separator \r\n
LOG_FILE studio.log
native.canonicalization false
ODI_ORACLE_HOME C:\oracle\product\11.1.1\Oracle_ODI_1\
oracle.core.ojdl.logging.config.file ODI-logging-config.xml
oracle.home C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client
oracle.odi.studio.ess false
oracle.odi.wls.template.generator.agentEarLocation C:\oracle\product\11.1.1\Oracle_ODI_1\setup\manual\oracledi-agent\oraclediagent.ear
oracle.security.jps.config ./jps-config.xml
oracle.translated.locales de,es,fr,it,ja,ko,pt_BR,zh_CN,zh_TW
oracle.xdkjava.compatibility.version 9.0.4
org.apache.commons.logging.Log org.apache.commons.logging.impl.Jdk14Logger
os.arch amd64
os.name Windows Server 2008 R2
os.version 6.1
path.separator ;
python.cachedir c:\Temp\cachedir
python.home C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting
python.packages.paths java.class.path,sun.boot.class.path,odi.class.path
reserved_filenames con,aux,prn,lpt1,lpt2,lpt3,lpt4,lpt5,lpt6,lpt7,lpt8,lpt9,com1,com2,com3,com4,com5,com6,com7,com8,com9,conin$,conout,conout$
sun.arch.data.model 64
sun.boot.class.path C:\Java\jre\lib\resources.jar;C:\Java\jre\lib\rt.jar;C:\Java\jre\lib\sunrsasign.jar;C:\Java\jre\lib\jsse.jar;C:\Java\jre\lib\jce.jar;C:\Java\jre\lib\charsets.jar;C:\Java\jre\classes;C:\Java\lib\tools.jar;C:\Java\lib\dt.jar
sun.boot.library.path C:\Java\jre\bin
sun.cpu.endian little
sun.cpu.isalist amd64
sun.desktop windows
sun.io.unicode.encoding UnicodeLittle
sun.java2d.noddraw true
sun.jnu.encoding Cp1251
sun.management.compiler HotSpot 64-Bit Server Compiler
sun.os.patch.level Service Pack 1
user.country RU
user.dir C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\odi\bin
user.home C:\Users\Администратор
user.language ru
user.name master
user.timezone Europe/Moscow
user.variant
windows.shell.font.languages en
External Components
Name Version Path
==== ======= ====
HspJS.jar 11.1.1.1.0 Build 137 Built with CIS Drop 27 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\HspJS.jar
HspJS.jar 11.1.1.1.0 Build 137 Built with CIS Drop 27 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\HspJS.jar
HspJS_11.1.2.0.jar 11.1.2.0.01.10 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\HspJS_11.1.2.0.jar
HspJS_11.1.2.0.jar 11.1.2.0.01.10 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\HspJS_11.1.2.0.jar
activation.jar 1.1 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\activation.jar
binding-2.0.2.jar 2.0.2 2008-01-18 10:01:08 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\binding-2.0.2.jar
coherence.jar 3.7.1.1 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\coherence.jar
commons-beanutils-1.7.0.jar 1.6 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\commons-beanutils-1.7.0.jar
commons-codec-1.3.jar 1.3 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\commons-codec-1.3.jar
commons-collections-3.2.jar 3.2 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\commons-collections-3.2.jar
commons-discovery-0.4.jar 0.4 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\commons-discovery-0.4.jar
commons-io-1.2.jar 1.2 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\commons-io-1.2.jar
commons-lang-2.2.jar 2.2 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\commons-lang-2.2.jar
commons-logging-1.1.1.jar 1.1.1 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\commons-logging-1.1.1.jar
commons-net-1.4.1.jar 1.4.1 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\commons-net-1.4.1.jar
commons-vfs-1.0.jar 1.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\commons-vfs-1.0.jar
cpld.jar Version 11.1.2.0.00, Build 589, March 25 2010 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\cpld.jar
cpld.jar Version 11.1.2.0.00, Build 589, March 25 2010 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\cpld.jar
dbswing.jar 011.000.044.108 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\dbswing.jar
dx.jar 007.001.175.112 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\dx.jar
eclipselink.jar 2.3.1.v20111018-r10243 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\eclipselink.jar
enterprise_data_quality.jar 11.1.1.6.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\enterprise_data_quality.jar
enterprise_data_quality.jar 11.1.1.6.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\enterprise_data_quality.jar
ess_es_server.jar 11.1.2.0.0.615 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\ess_es_server.jar
ess_es_server.jar 11.1.2.0.0.615 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\ess_es_server.jar
ess_japi.jar 11.1.2.0.0.615 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\ess_japi.jar
ess_japi.jar 11.1.2.0.0.615 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\ess_japi.jar
fmwgenerictoken.jar 1.0.0.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\..\..\..\..\..\odi_misc\fmwgenerictoken.jar
forms-1.2.0.jar 1.2.0 2008-02-23 08:37:50 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\forms-1.2.0.jar
groovy-all-1.7.4.jar 1.7.4 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\groovy-all-1.7.4.jar
hsqldb.jar 2.0.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\hsqldb.jar
http_client.jar December 9 2011 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\http_client.jar
javax.security.jacc_1.0.0.0_1-1.jar 1.1 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\javax.security.jacc_1.0.0.0_1-1.jar
mail.jar 1.4 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\mail.jar
odi-sap.jar 10.1.3.12 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\odi-sap.jar
odi_hfm.jar 11.1.1.6.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\odi_hfm.jar
odi_hfm.jar 11.1.1.6.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\odi_hfm.jar
odihapp_essbase.jar 11.1.1.6.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\odihapp_essbase.jar
odihapp_essbase.jar 11.1.1.6.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\odihapp_essbase.jar
odihapp_planning.jar 11.1.1.6.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\odihapp_planning.jar
odihapp_planning.jar 11.1.1.6.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\odihapp_planning.jar
odihapp_planning_11.1.2.0.jar 11.1.1.6.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\odihapp_planning_11.1.2.0.jar
odihapp_planning_11.1.2.0.jar 11.1.1.6.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\odihapp_planning_11.1.2.0.jar
ojdbc6dms.jar 11.2.0.3.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\ojdbc6dms.jar
oracle.ucp_11.1.0.jar 11.2.0.3.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\oracle.ucp_11.1.0.jar
pop3.jar 1.1.1 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\pop3.jar
spring-aop.jar 2.0.3 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\spring-aop.jar
spring-beans.jar 2.0.3 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\spring-beans.jar
spring-context.jar 2.0.3 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\spring-context.jar
spring-core.jar 2.0.3 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\spring-core.jar
spring-dao.jar 2.0.3 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\spring-dao.jar
spring-jdbc.jar 2.0.3 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\spring-jdbc.jar
spring-jmx.jar 2.0.3 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\spring-jmx.jar
spring-jpa.jar 2.0.3 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\spring-jpa.jar
spring-web.jar 2.0.3 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\spring-web.jar
trove.jar 2.1.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\trove.jar
wlthint3client.jar 10.3.5.0 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi.sdk\lib\wlthint3client.jar
woodstox.jar 3.2.1 C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\lib\woodstox.jar
Extensions
Name Identifier Version Status
==== ========== ======= ======
BM metamodel framework oracle.bm.meta 11.1.1.6.38.61.92 Loaded
Code Editor oracle.ide.ceditor 11.1.1.6.38.61.92 Loaded
Diagram Framework oracle.diagram 11.1.1.6.38.61.92 Loaded
Diagram Javadoc Extension oracle.diagram.javadoc 11.1.1.6.38.61.92 Loaded
Diagram Thumbnail oracle.diagram.thumbnail 11.1.1.6.38.61.92 Loaded
Extended IDE Platform oracle.javacore 11.1.1.6.38.61.92 Loaded
Groovy Support oracle.ide.groovy 11.1.1.4.37.58.91 Loaded
Help System oracle.ide.help 11.1.1.6.38.61.92 Loaded
Import/Export Support oracle.ide.importexport 11.1.1.6.38.61.92 Loaded
Index Migrator support oracle.ideimpl.indexing-migrator 11.1.1.6.38.61.92 Loaded
JViews Registration Addin oracle.diagram.registration 11.1.1.6.38.61.92 Loaded
Log Window oracle.ide.log 11.1.1.6.38.61.92 Loaded
Modeler Framework oracle.modeler 11.1.1.6.38.61.92 Loaded
Modeler Framework Common Layer oracle.modeler.common 11.1.1.6.38.61.92 Loaded
Navigator oracle.ide.navigator 11.1.1.6.38.61.92 Loaded
ODI Navigator oracle.odi.navigator 11.1.1.6.0.0.0 Loaded
Object Gallery oracle.ide.gallery 11.1.1.6.38.61.92 Loaded
Oracle Data Integrator oracle.odi 11.1.1.6.0.0.0 Loaded
Oracle IDE oracle.ide 11.1.1.6.38.61.92 Loaded
Peek oracle.ide.peek 11.1.1.6.38.61.92 Loaded
Persistent Storage oracle.ide.persistence 11.1.1.6.38.61.92 Loaded
Property Inspector oracle.ide.inspector 11.1.1.6.38.61.92 Loaded
Runner oracle.ide.runner 11.1.1.6.38.61.92 Loaded
Virtual File System oracle.ide.vfs 11.1.1.6.38.61.92 Loaded
Web Browser and Proxy oracle.ide.webbrowser 11.1.1.6.38.61.92 Loaded
audit oracle.ide.audit 11.1.1.6.38.61.92 Loaded
jdukshare oracle.bm.jdukshare 11.1.1.6.38.61.92 Loaded
mof-xmi oracle.mof.xmi 11.1.1.6.38.61.92 Loaded
oracle.ide.indexing oracle.ide.indexing 11.1.1.6.38.61.92 Loaded
palette2 oracle.ide.palette2 11.1.1.6.38.61.92 LoadedYou might want to look at the documentation related to Microsoft Excel Microsoft Excel - 11g Release 1 (11.1.1)
-
How to extract table from oracle in to delimited flat files
Hi i have the following requirement.i tried one dump procedure but i could extract table one by one.i need to do extract on regular basis using plsql procedure.
Data will be extracted from production tables in Oracle into pipe delimited flat files that will be sent by SFTP. The list below represents the tables that will be used for extract along with a notation whether the entire table is extracted or only incremental transactional data.
Table name extraction type No of records
EXPIRE All Records 157 - One Time All Records 17
ACE All Records 7,970
DATA All Records 5,868
MEMBER All Records 24,794,879
MEMBER Incremental & Update 13,893,587 (Initial Load)
MEMBERRED All Records 25,108,606
MEMBERPOINT All Records 42,487,640
MEMBERCOM Incremental & Update 14,337,561 (Initial Load)
MEMBERCODE Incremental Only 14,985,568 (Initial Load)
MEMBERDETAIL Incremental Only 14,341,890 (Initial Load)
MEMBERHISTORY Incremental Only 70,021,067 (Initial Load)
suggest me how can i extract these tables by using plsql procedure.In the above table some table has be extract select list of column.Saubhik wrote:
This may help you.
Re: Dynamic Fetch on dynamic Sql
Well I was going to post my standard response, but I see I don't have to. ;) -
Generating a Delimited Flat File
Halo BSP Gurus,
I am in need where I have to generate a delimited flat file. I would like to know whether it is possible in BSP and if so how to achieve that.
Your Suggestions will be appreciated.
Regards
Leogeneration is not a problem, its just a concatenation of field values with propet delimiters . but what do you want to do with the generated file content,
automatically store it in client desktop?
mail it?
regards
Raja -
Uploading comma delimited text file
Dear Experts,
I want to upload comma delimited text file in sap and get that values into internal table
Can any 1 provide a sample code ??
thanx in advance.Hi Suchitra ,
There is FM GUI_UPLOAD which will help you in this.
Its has got one parameter calles has_field_separator . Here you can pass comma. So that this will take care while uploading the data in Internal table.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = wf_file
filetype = 'ASC'
has_field_separator = ','
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
data_tab = it_data
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17
Hope this will help you.
Regards,
Nikhil -
Comma delimited text file using pl/sql ???
Hi friends
I want to create a comma delimited text file from emp table like using pl/sql program. I have oracle 8.0.4.0.0 production.
emp.txt
7844,TURNER,SALESMAN,7698,08-SEP-81,1500,0,30
7876,ADAMS,CLERK,7788,23-MAY-87,1100,,20
7900,JAMES,CLERK,7698,03-DEC-81,950,,30
Thanks
SaiHi Justin
I traced out the error message, is below,
1 declare
2 fh utl_file.file_type;
3 d varchar2(20) := 'sample data';
4 sql_err number(10);
5 error_info varchar2(60);
6 begin
7 fh := utl_file.fopen('c:\','A.TXT','A');
8 utl_file.put(fh,d);
9 dbms_output.put_line('file created');
10 d:='&urdata';
11 utl_file.putf(fh,'\n given data is %s\n',d);
12 utl_file.put_line(fh,'this is last line');
13 utl_file.put(fh,'hello');
14 utl_file.fflush(fh);
15 utl_file.fclose(fh);
16 exception
17 when others then
18 sql_err := SQLCODE;
19 error_info := SQLERRM;
20 dbms_output.put_line(SQL_ERR||'-'||error_info);
21 if utl_file.is_open(fh) then
22 utl_file.fclose(fh);
23 end if;
24* end;
SQL> /
Enter value for urdata: TEST
old 10: d:='&urdata';
new 10: d:='TEST';
1-User-Defined Exception
PL/SQL procedure successfully completed.
Sai -
Importing a delimited flat file, what are the options?
Hi,
I need to import some data from an Informix database into oracle.
Informix exports it's data into a delimited flat file. Once I have created the schema, tables in Oracle whats the best way to import the data into Oracle?
Should I just create a massive SQL script with insert commands for each line or is there a better way?
any help/ideas appreciated.
Thanks.SQLLoader and/or External tables are at least two options. These will be definitely faster than insert scripts.
Gints Plivna
http://www.gplivna.eu -
Ssrs 2012 export to comma delimited (csv) file problem
In an ssrs 2012 report, I want to be able to export all the data to a csv (comma delimited) file that only contains the detailed row information. I do not want to export any rows that contain header data information.
Right now the export contains header row information and detail row information. The header row information exists for the PDF exports.
To have the header row not exist on CSV exports, I have tried the following options on the tablix with the header row information with no success:
1. = iif(Mid(Globals!RenderFormat.Name,1,5)<>"EXCEL",false,true),
2. = iif(Mid(Globals!RenderFormat.Name,1,3)="PDF",false,true),
3. The textboxes that contain the column headers, the dataelelementoutput=auto and
the text boxes that contain the actual data, I set the dataelelementoutput=output.
Basically I need the tablix that contains the header information not to appear when the export is for a csv file.
However when the export is for the detail lines for the csv export, I need that tablix to show up.
Thus can you tell me and/or show me code on how to solve this problem?Hi wendy,
Based on my research, the expression posted by Ione used to hide items only work well when render format is RPL or MHTML. Because only the two render format’s RenderFormat.IsInteractive is true.
In your scenario, you want to hide tablix header only when export the report to csv format. While CSV file uses the textbox name in detail section as the column name, not the table header when you view the table. So if we want to hide the header row of the
tablix, please refer to the steps below to enable the “NoHeader” setting in the RSReportserver.config file:
Please navigate to RSReportserver.config file: <drive:>\Program Files\Microsoft SQL Server\MSRS1111.MSSQLSERVER\Reporting Services\ReportServer \RSReportserver.config.
Backup the RSReportserver.config file before we modify it, open the RSReportserver.config file with Notepad format.
In the <Render> section, add the new code for the CSV extension like this:
< Extension Name="CSV" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering">
<Configuration>
<DeviceInfo>
<NoHeader>True</NoHeader>
</DeviceInfo>
</Configuration>
< /Extension>
Save the RSReportserver.config file.
For more information about CSV Device Information Settings, please see:
http://msdn.microsoft.com/en-us/library/ms155365(v=sql.110)
If you have any other questions, please feel free to ask.
Thanks,
Katherine xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support -
CR & LF characters at the end of records when using delimited flat file (CR is missing)
Hi All,
I have a requirement where data of SQL query needs to be loaded to a CSV file.
The row delimiter of the CSV file has to be CR-LF.
In the flat file connection manager, I have mentioned Header Row delimiter as "{CR}{LF}" and under columns section, row delimiter is specified as "{CR}{LF}".
But when I open the detsnation CSV file using notepad++, I see only "LF" at the end of all rows.
Can you please let me know how can I get both CR & LF at the end of each row
Below is the screen shot of the flat file connection manager which I have used for CSV destination file:
RakshaHi Raksha,
Just as Vaibhav said, I’m curious why you need use “CR & LF” as row delimiter in Flat File Connection Manage. Since you can use "CR" as row delimiter in Flat File Connection Manager and it worked fine, you can directly specify "CR"
as row delimiter in Flat File Connection Manage.
Besides, if you still want to replace “LF” with “CR & LF” in the text file, we can use Notepad++’s Find/Replace feature or Edit -> EOL Conversion to achieve the goal. Then we can specify "CR & LF" as row delimiter in Flat File
Connection Manage.
The following blog about conversion between “LF” and “CR & LF” row delimiter in Notepad++ is for your reference:
http://sqlblog.com/blogs/jamie_thomson/archive/2012/08/07/replacing-crlf-with-lf-using-notepad.aspx
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Pipe delimited flat file.
Hello everyone out there!!
I have a flat file which contains the fields in the following manner:
MATNR| sloc | date | plant |
Basically a pipe delimited file. So can anybody pls help me on how would I read this flat file and seperate the fields into the ITAB.
Thanks a lot in advance!!Hi Amrita,
Use this sample code.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lv_file
filetype = 'ASC'
has_field_separator = '|'
header_length = 0
read_by_line = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
ignore_cerr = 'X'
replacement = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
data_tab = data_mat
* EXCEPTIONS
* FILE_OPEN_ERROR = 1
* FILE_READ_ERROR = 2
* NO_BATCH = 3
* GUI_REFUSE_FILETRANSFER = 4
* INVALID_TYPE = 5
* NO_AUTHORITY = 6
* UNKNOWN_ERROR = 7
* BAD_DATA_FORMAT = 8
* HEADER_NOT_ALLOWED = 9
* SEPARATOR_NOT_ALLOWED = 10
* HEADER_TOO_LONG = 11
* UNKNOWN_DP_ERROR = 12
* ACCESS_DENIED = 13
* DP_OUT_OF_MEMORY = 14
* DISK_FULL = 15
* DP_TIMEOUT = 16
* OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
LOOP AT data_mat.
SPLIT data_mat-datastring AT '|' INTO
it_data-old_matno
it_data-x_comp
it_data-alt_uom
it_data-y_comp
it_data-matnr.
APPEND it_data.
CLEAR it_data.
ENDLOOP.
ENDIF.
Reward if helpful.
Regards
Aneesh. -
Getting correct field length when creating formats for delimited flat files
Using Data Services 3.2 to pull in tsv and Excel source files.
When creating a new format for each file, DS tries to intelligently set the field size for each column. However, it seems to sample only a portion of the file. The end result is that it often determines too short a length for a field.
Is there a way to force it to scan an entire file before it sets the field length? Or alternatively, how to get it to at least throw an error instead of silently truncating my data?I am not aware of any way to force DS to scan the whole file, or to log a warning when it truncates. The field sizes DS sets by using a sample of the data is only really to give you a starting point, you need to try and determine the maximum possible lengths preferably from someone who understands the source of the data or through profiling. But the profiling method will obviously only be based on the data you have at the time of profiling, new data added to the source later could exceed the field lengths. The way I prefer to handle this is to set all the field lengths to longer than expected, eg. varchar(999) and then use a validation transform immediately after reading the file to check for any fields that exceed the maximum allowed for the target system and send these to an error file/table.
-
How to upload comm seperated flate file into sap r/3?
plz send me any simple report program
Hi,
Please refer code below:
data : begin of itab1 occurs 0,
values(1000) type c,
end of itab1.
PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
DATA : filename TYPE string.
DATA : w_textout LIKE t100-text.
DATA: BEGIN OF messtab OCCURS 0.
INCLUDE STRUCTURE bdcmsgcoll.
DATA: END OF messtab.
data : begin of itab occurs 0,
BLDAT(10) TYPE C,
BLART(2) TYPE C,
BUKRS(4) TYPE C,
BUDAT(10) TYPE C,
MONAT(2) TYPE C,
WAERS(5) TYPE C,
NEWBS(2) TYPE C,
NEWKO(17) TYPE C,
WRBTR(13) TYPE C,
SGTXT(50) TYPE C,
GSBER(4) TYPE C,
KOSTL(10) TYPE C,
AUFNR(10) TYPE C,
TNEWBS(2) TYPE C,
TNEWKO(17) TYPE C,
TWRBTR(13) TYPE C,
end of itab.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
start-of-selection.
filename = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = filename
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
DATA_TAB = itab1
* EXCEPTIONS
* FILE_OPEN_ERROR = 1
* FILE_READ_ERROR = 2
* NO_BATCH = 3
* GUI_REFUSE_FILETRANSFER = 4
* INVALID_TYPE = 5
* NO_AUTHORITY = 6
* UNKNOWN_ERROR = 7
* BAD_DATA_FORMAT = 8
* HEADER_NOT_ALLOWED = 9
* SEPARATOR_NOT_ALLOWED = 10
* HEADER_TOO_LONG = 11
* UNKNOWN_DP_ERROR = 12
* ACCESS_DENIED = 13
* DP_OUT_OF_MEMORY = 14
* DISK_FULL = 15
* DP_TIMEOUT = 16
* OTHERS = 17
LOOP AT ITAB1.
SPLIT ITAB1 AT ',' INTO ITAB-BLDAT ITAB-BLART ITAB-BUKRS ITAB-BUDAT ITAB-MONAT
ITAB-WAERS ITAB-NEWBS ITAB-NEWKO ITAB-WRBTR ITAB-SGTXT ITAB-GSBER ITAB-KOSTL ITAB-AUFNR.
APPEND ITAB.
ENDLOOP.
Thanks,
Sriram Ponna. -
I've created an SSIS package to import a comma delimited file (csv) with double quotes for a text qualifier ("). Some of the fields contain the delimiter inside the qualified text. An example row is:
15,"Doe, John",IS2,Alabama
In SSIS I've specified the text qualifier as ". The sample output in the connection manager looks great. The package runs perfectly from VS and when manually executed on the SSIS server itself. The problem comes when I schedule the package to run via SQL
job. At this point the package ignores the text qualifier, and in doing so pushes half of a field into the next available column. But instead of having too many columns, it concatenates the last 2 columns ignoring the delimiter. For example (pipes are fields):
15|"Doe| John"|IS2,Alabama
So the failure happens when the last half of a field is too large to fit into the next available field. In the case above _John" is 6 characters where the IS2 field is char(3). This would cause a truncation failure, which is the error I receive from the
job history.
To further test this I created a failure flow in my data flow to capture the records failing to be pulled from the source csv. Out of ~5000 records, ~1200 are failing, and every one of the failures has a comma delimiter inside the quoted text with a 'split'
length greater than the next ordinal field. The ones without the comma were inserted as normal and records where the split fit into the next ordinal column where also imported, with the last field being concatenated w/delimiter. Example records when selected
from table:
25|"Allan Percone Trucking"|GI6|California --Imported as intended
36|"Renolds| J."|UI6,Colorado --Field position offset by 1 to right - Last field overloaded
To further ensure this is the problem, I changed the csv file and flat file connection manager to pipe delimited, and sure enough every record makes it in perfectly from the SQL job execution.
I've tried comma delimited on the following set ups. Each set up failed.
SSIS Server 2008 R2 RTM
DB Server 2008 RTM
DB Compat 80
SSIS Server 2008 R2 RTM
DB Server 2008 R2 RTM
DB Compat 80
SSIS Server 2008 R2 RTM
DB Server 2008 RTM
DB Compat 100
SSIS Server 2008 R2 RTM
DB Server 2008 R2 RTM
DB Compat 100
Since a lot of our data comes in via comma delimited flat files, I really need a fix for this. If not I'll have to rebuild all my files when I import them to use pipe delimiters instaed of commas. I'd like to avoid the extra processing overhead if possible.
Also, is this a known bug? If so can someone point me to the posting of said bug?
Edit: I can't ask the vendor to change the format to pipe delimited because it comes from a federal government site.Just wanted to share my experience of this for anyone else since I wasted a morning on it today.
I encountered the same problem where I could run the package fine on my machine but when I deployed to a server and ran the package via dtexec, the " delimeter was being replaced with _x0022_ and columns all slurped up together and overflowing columns/truncating
data etc.
Since I didn't want to manually hack the DTS XML and can't install updates, the solution I used was to set an expression on the textdelimiter field of the flat file connection with the value "\"" (a double quote). That way, even if the one stored in XML
gets bodged somewhere along the way, it is overridden with the correct value at run time. The package works fine everywhere now. -
After working with flat files (especially text and CSV) for some time in my current role I have decided to come up with this little discussion which I believe may benefit peers who might not yet have come across some of the issues that I have raised in this
piece. This piece is just a summary of what I have thought would be useful hints for anyone to consider when they are working with CSV or text files. Everything in this writing is purely from my experience and I am discussing it at SSIS level. I believe most
of the actions can be applied across in SSMS when dealing with flat files there.
Flat files as destination file
Exporting data to flat file destination is relatively easy and straight forward. There aren’t as many issues experienced here as they are when one imports data from flat files. However, whatever one does here hugely impacts on how easy and straightforward
importing data down the line from your flat file that you create at this stage will be. There are a few things to note. When you open your Flat File Destination component, of the options that you will see – listed below is a discussion of some of them. I have
found it useful to take the actions which I have mentioned below.
Column names in the first row – If you want the column names to be in the first row on your file make sure that you always check the box with that option. SSIS does not do that for you by default.
Column delimiter – I always prefer to use Tab {t}. The default delimiter is Comma {,}. The problem that I have found with use of comma delimiters is that if the values have inherent commas within them the system does not always get it right
in determining where the column ends. As a result you may end up getting some rows with shifted and misplaced values from their original columns owing to the wrong column allocation by the system.
AlwaysCheckForRowDelimiters – this is a Flat File Connection Manager property. The default setting of this property is True. At one time I found myself having to use this after I faced a huge problem with breaking and misplacement of rows
in the dataset that I was dealing with. The problem emanated from the values in one of the columns. The offending column had values of varchar datatype which were presented in the form of paragraphs with all sorts of special characters within them, e.g.
This is ++, an example of what – I mean… the characters ;
in the dataset which gave me: nearly 100% ++ headaches – looked like {well}; this piece
OF: example??
You can see from the above italicised dummy value example what I mean. Values such as that make the system to prematurely break the rows. I don’t know why but the somehow painful experience that I had about this led me to the conclusion that I should not
leave the system to auto-decide where the row ends. As such, when I changed the property
AlwaysCheckForRowDelimiters from True to False, along with the recommendations mentioned in items 1 and 2 above, breaking and misplacement of rows was solved. By breaking I mean - you will find one row in a table being broken into two
or three separate rows in the flat file. This is carried over to the new table where that flat will is loaded.
Addendum
There is an additional option which I have found to work even better if one is experiencing issues with breaking of rows due to values being in the ‘paragraph’ format as illustrated above. The option for ‘paragraphed’ values which
I explained earlier works, but not always as I have realised. If that option does not work, this is what you are supposed to do
When you SELECT the data for export from your table, make your SELECT statement to look something like this
SELECT
ColumnName1,
ColumnName2,
ColumnName3,
REPLACE(REPLACE(OffendingColumnNameName,CHAR(10),''),CHAR(13),'')
AS OffendingColumnNameName,
ColumnName4
FROM
MyTableName
The REPLACE function gets rid of the breaks on your values. That is, it gets rid of the paragraphs in the values.
I would suggest use of double dagger column delimiters if using this approach.
Text or CSV file?? – In my experience going with the text file is always efficient. Besides, some of the things recommended above only work in text file (I suppose so. I stand to be corrected on this). An example of this is column delimiters.
Item 2 above recommends use of Tab {t} column delimiter whereas in CSV, as the name suggests, the delimiters are commas.
Flat files as source file
In my experience, many headaches of working with flat files are seen at importing data from flat files. A few examples of the headaches that I’m talking about are things such as,
Datatypes and datatype length, if using string
Shifting and misplacement of column values
Broken rows, with some pseudo-rows appearing in your import file
Double quotation marks in your values
Below I will address some of the common things which I have personally experienced and hope will be useful to other people. When you open your Flat File Source component, of the options that you will see – listed below is a discussion of some of them. I
have found it useful to take the actions which I have mentioned below.
Retain null values from the source as null values in the data flow – this option comes unchecked by default. From the time I noticed the importance of putting a check mark in it, I always make sure that I check it. It was after some of
my rows in the destination table were coming up with shifted and misplaced column values. By shifted and misplaced column values I mean certain values appearing under columns where you do not expect them, by so doing showing that purely the value has
been moved from its original column to another column where it does not belong.
Text qualifier – the default entry here is <none>. I have found that it is always handy to insert double quotes here (“). This will eliminate any double quotes which the system may have included at the time when the flat file was
created. This happens when the values in question have commas as part of the characters in them.
Column delimiter – this solely depends on the column delimiter which was specified at the time when the flat file was created. The system default is Comma {,}. Please note that if the delimiter specified here is different from the one in
your flat file the system will throw up an error with a message like “An error occurred while skipping data rows”.
Column names in the first data row – if you want the first row to be column names put a check mark on this option.
Datatypes and datatypes length
By default when you import a flat file your datatypes for all the columns come up as varchar (50) in SSIS. More often than not if you leave this default setup your package will fail when you run it. This is because some of the values in some of your columns
will be more than 50 characters, the default length. The resulting error will be a truncation error. I have found two ways of dealing with this.
Advanced – This is an option found on the Flat File Source Editor. Once this option is selected on your Flat File Source Editor you will be presented with a list of columns from your flat file. To determine your datatypes and length there
are two possible things that you can do at this stage.
Go column by column – going column by column you can manually input your desired datatypes and lengths on the Flat File Source Editor through the Advanced option.
Suggest types – this is another option under Advanced selection. What this option does is suggest datatypes and lengths for you based on the sample data amount that you mention in the pop-up dialog box. I have noticed that while this is
a handy functionality, the problem with it is that if some of the values from the non-sampled data have lengths bigger than what the system would have suggested the package will fail with a truncation error.
View code – this is viewing of XML code. If for example you want all your columns to be of 255 characters length in your landing staging table
Go to your package name, right click on it and select the option View code from the list presented to you. XML code will then come up.
Hit Ctrl + F to get a “Find and Replace:” window. On “Find What” type in
DTS:MaximumWidth="50" and on “Replace with:” type in
DTS:MaximumWidth="255". Make sure that under “Look in” the selection is
Current Document.
Click “Replace All” and all your default column lengths of 50 characters will be changed to 255 characters.
Once done, save the changes. Close the XML code page. Go to your package GUI designer. You will find that the Flat File Source component at this point will be highlighted with a yellow warning triangle. This is because the metadata definition has changed.
Double click the Flat File Source component and then click on Ok. The warning will disappear and you will be set to pull and load your data to your staging database with all columns being varchar (255). If you need to change any columns to specific data types
you can either use Data Conversion Component or Derived Column component for that purpose, OR you can use both components depending on the data types that you will converting to.
Dynamic Flat File Name and Date
Please see this blog
http://www.bidn.com/blogs/mikedavis/ssis/153/using-expression-ssis-to-save-a-file-with-file-name-and-date
There is so much to flat files to be discussed in one piece.
Any comments plus additions (and subtractions too) to this piece are welcome.
MpumeleloYou could create a
WIKI about this subject. Also see
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/f46b14ab-59c4-46c0-b125-6534aa1133e9/ssis-guru-needed-apply-within?forum=sqlintegrationservices
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com |
Twitter
Maybe you are looking for
-
Whenever I leave the main VI screen, the data is no longer able to be read.
I have a VI that I have used on and off on a test stand of mine for a year and a half. Yesterday, I ran it for the first time in about a month, and the VI had developed a peculiar problem. Whenever I leave the main VI screen and go back to it, data i
-
OSB - how to handle poll file error in FTP Proxy Service
I configed a proxy service to poll file from a FTP server. How can I capture the error when the proxy service cannnot poll? (FTP server is down, folder not found, username invalid, etc ) I want to make it show in the Operations >Message Reports table
-
Loading flat idoc via report RSEINB00 into integration server fails
Hi, we have PI/700. We get idocs (in flat format NOT XML) via filesystem from an external partner. Now I try to load these idocs with the report RSEINB00 into my integration server. My problem is, that the report says that the sender port + client(of
-
Hi, We are converting Oracle Forms from 6i to 11g. We have some forms that use read_image_file to read image. It was .bmp file and now we can only use .gif/.jpg file on web and the image is very blurry.(we use the same .gif source file for image and
-
UTL_FILE help/samples
Hello Folks, I need to write a routine to read in a CSV file parse it and inser the data into a table. Does anybody have examples? TIA