Problem while writing to fixed length flat file from xml
Hi,
I have a problem in writing data into a flat file of fixed length...
My input is a xml file and i want the output as a flat file. I am successful in converting the xml into flat file... But the main problem is, i am unable to insert spaces in between my fields in the flat file.
The data in the flat file comes without spaces... Any suggestions on writing the schema...
Regards
Surya.
Have a look at this doc
http://otndnld.oracle.co.jp/document/products/as10g/101310/doc_cd/integrate.1013/b28994/nfb.htm#BGBBAJFD
your element should be something like this, it pads with a space using the paddedBy expression
<xsd:element name="C1" type="xsd:string" nxsd:style="fixedLength" nxsd:length="4" nxsd:paddedBy=" " nxsd:padStyle="tail" />if having trouble post what you want the file to look like, and the xsd you are using.
cheers
James
Similar Messages
-
How to create Fixed Length Flat File from Open Hub in BI 7.0
My requirement is to produce a Fixed length Flat file by Open Hub destination. My Open Hub has four fields. Now the requirement is to create another extra field in Open Hub which will contain all of the four fields value. In addition to that the fields should be fixed length that means if for any field no value is there and the field length/type is CHAR4 then 4 spaces should be there as the field value. SO, basically the Open Hub output will be single field which will contain information of four fields.
How to get this using End Routine of Transformation (from DSO to Open Hub) ?Hi,
You can map the four input fields to the new field in the Open Hub, and change rule type to "Routine".
For example, if your source fields are called "first", "second", "third" and "forth", the ABAP routine could be similar to:
DATA: l_t_1 TYPE C LENGTH 4,
l_t_2 TYPE C LENGTH 4,
l_t_3 TYPE C LENGTH 4,
l_t_4 TYPE C LENGTH 4.
IF source_fields-first IS INITIAL.
l_t_1 = ' '.
else.
MOVE source_fields-first TO l_t_1.
endif.
IF source_fields-second IS INITIAL.
l_t_2 = ' '.
else.
MOVE source_fields-second TO l_t_2.
endif.
IF source_fields-third IS INITIAL.
l_t_3 = ' '.
else.
MOVE source_fields-third TO l_t_3.
endif.
IF source_fields-forth IS INITIAL.
l_t_4 = ' '.
else.
MOVE source_fields-forth TO l_t_4.
endif.
CONCATENATE l_t_1 l_t_2 l_t_3 l_t_4 into result.
In the example, the program uses four blank spaces if any of the fields has no value.
Additionally, if non-initial values in input fields could be shorter than 4 characters (if the input fields have no fixed length), you could use STRLEN to evaluate if it is necessary to add blank spaces to complete the fixed length of 4.
I hope this helps you.
Regards,
Maximiliano -
Conversion of fixed length flat files to oracle table
hello friends
Please help me getting the code for conversion of fixed length flat files to oracle table
Should the tables be pre-defined ?????
In this case the de-limiters are variable length spaces and not commas.Please help me with the same
Regards,
-MaheshYou can use SQL*Loader to load fixed-width files into Oracle. Instructions on writing appropriate control files are in the Oracle Utilities manual
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch03.htm#1004687
You can also use external tables, assuming you're using 9i or later (the syntax for external table definitions is nearly identical to the syntax for SQL*Loader control files).
You'll need to create a table definition in Oracle. You can either create a "normal" table and use SQL*Loader to populate it or you can create an external table definition.
Justin -
I am working on creating a fixed length flat file with data from multiple files.
This flat file will have 4 different record formats.
My idea is to create a table for each one of these record formats, populate it in my PL/SQL program and utilize the [DUMP_CSV|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:95212348059] procedure to then select from each of these tables. My idea is that if the record format changes it could be as simple as altering the table, and recompiling the program. Suggestions/comments on my approach?
ThanksUse External Tables. By that you can even skip the PL/SQL code that you may need to write if you use normal table to load them.
-
Java value objects to fixed-length flat file?
I am searching for framework or third party API, which can convert a java bean to fixed length record.
I want to automate this solution, using some mapping files. (Like hibernate API for java <----> xml conversions)
if anybody can give me any url or suggest ways, i would appreciate that...
thanks
ashishBut as business requirements change or new
integration happens.. it is possible, You can count on it.
java beans get
more data elements.. so i want solution which is
flexible easy to change or experiment ..during
development and after being deployed. I would create two classes for representing the copybook layout. One for the whole thing and another for each element. Each field will have the length type and any special formatting rules. i.e. you will have mutiple types of field classes implementing the Field interface. Then put these in a LinkedHashMap and as you are adding them set another field which will be the offset from the beiginning of the record. The Record class will hold these Fields and other Records.
Then create a schema text file format and load that in on startup. Then you buld the data like a you would a DOM model in your application.
I wish someone had done that in our code instead of copying, pasting and editing this:
int length = 10;
int offset = 500;a bazillion times. That's real fun when you want to add fields. The damn methods aren't even in consecutive order. -
Time Stamp problem while writing data into the excel file
Hii, All
I am taking the data from the DAQ card of the TOPSCCC with the 8 ms of scanrate for each channel and there are total 16 no of Analog channels in the Card, now i am acquiring the data from the card, time stamping it and writing it into the excel file, which is tab delimited, now the problem is, the data which are in the excel file have the same timestamp for 4 to 5 continuous records, instead we want each data with the different and continuous time stamp with same difference of time stamp between two records, mean if it is difference of 8 ms then it should be the 8 ms for all, but here it is taking the differnce of 16 ms for two samples and giving same time stamp for four to five records and that shouldn't happen, here i am attaching my vi, drivers for the cards and Excel file with the data, can you please give me any suggestion how to do it?
Please help me i require this suggestion as early as possible, i am requiring it urgently.
Thanks in Advance,
Nishant
Attachments:
2026vi.llb 319 KB
2026_ScanMultAD_Demo_time.vi 80 KB
Data.xls 357 KBHello Nishant,
that's what I meant:
Message Edited by GerdW on 05-16-2006 10:32 AM
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome
Attachments:
timestamp-array.png 2 KB -
Require script to load fixed length flat file
Hi
Can anyone provide me a script to load a flat file into database ? A sample script would be ok
thanks in advance
SivaYou can use SQL*Loader to do this, or external tables in 9i or higher. These methods are well-documented in the Utilities Guide.
Cheers, APC -
File Adapter: Flat-file to XML
New to the Oracle ESB.
I am using the file adapter to read in a fixed-length flat file, have mapped it to an xsd and now I just want to dump the resulting xml into a directory. I don't see an obvious way to do this without converting it back to a flat file (by pointing the file writer back to a similar flat file xsd). Missing something obvious?
Thank you!File Adapters content conversion does not supprot such a nested strucutre currently.
The only format supported is the one shown in ths link,
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
Either write a module that will do this conversion or Change the datatye for the source to the format shown in help.sap.
Regards
Bhavesh -
CONVERTION OF FLAT FILE TO XML : NO OUT PUT FOUND
Hi XI Experts,
I am not getting output while creating a scenario of flat file to xml file. I have set the file content conversion parameter correctly...the file which is .txt is picking up but I m not getting the file in the output directory.
CAN ANYONE HELP ME.....PLS!!!
Thanks in advance...Hi,
The follwoing is the mapping str I created and also I have pasted the FCC parameters,
I want to send the .txt file which contains the data as
Sunil,Bangalore
Shetty,Bangalore
( for multiple records..)
Note : I m getting the o/p for single records...
Pls help me.....
Sender Target
Record Record
Row Row
Name string 1..unbounded ---> Name string 1..unbounded
Addr string 1..unbounded ---> Addr string 1..unbounded
Source Dir : c:/send
File Name : send.txt
Document Name : Message type name
Document Namespace : urn:....
Recordset Name : Record
Recordset Structure: Row,*
Row.fieldNames : Name,Addr
Row.fieldSeparator : ,
Row.processConfiguration : FromConfiguration
Row.endSeparator : 'nl'
Thanks in Advance.... -
Problem while writing data on xls file using jxl API
Hi,
I am getting problem while writing data on excel file using jxl api.
When i write data on file and all handles associated to the file are closed, file size increases but when i open the file nothing is written in it and when file is closed manually from excel window, file size decreased to its original that was before writing data.
here is code:
FileOutputStream os = new FileOutputStream(this.dirPath + this.fileName, true);
WritableWorkbook this.workbook = Workbook.createWorkbook(os);
after writing data following handler are closed:
this.os.flush();
this.workbook.write();
this.workbook.close();
this.os.close();
this.os = null;
can any body help me.
Thanks in advanceErr, I did help you. I did understand your problem; and I solved it for you. What was missing was that you apparently made no effort to understand what you were being told. Or even consider it. You just argued about it, as though you were the one with the solution, instead of the one whose code didn't work.
And the other thing that was missing was the part where you said 'thank you' to me for solving your problem. Somewhat more appropriate than biting the hand that fed you, frankly. I do this for nothing, on my own gas, and it's extremely irritating when people keep asking about problems I have already solved for them. I am entitled to discourage that. It's part of making them more efficient actually.
But it happens often enough that it also makes me think I'm just wasting my time. Probably I am. -
Problem Reading Flat File from Application server
Hi All,
I want to upload a Flat File which is having a Line Length of 3000.
While uploading it to Application server , only upto 555 length it is getting uploaded .
i am using the code :
DATA: BEGIN OF TB_DATA OCCURS 0,
LINE(3000),
END OF TB_DATA.
*----Uploading the flat file from the Local drive using FM "UPLOAD".
OPEN DATASET TB_FILENAM-DATA FOR OUTPUT IN TEXT MODE." ENCODING DEFAULT.
IF SY-SUBRC NE 0.
WRITE:/ 'Unable to open file:', TB_FILENAM-DATA.
ELSE.
LOOP AT TB_DATA.
TRANSFER TB_DATA TO TB_FILENAM-DATA.
ENDLOOP.
ENDIF.
CLOSE DATASET TB_FILENAM-DATA.
What could be the problem?
Could it be due to any Configuration Problem?
Waiting for your replies.
Thanks and Regards.
SukiYour code looks OK, but you may have touble displaying the full width. Try:
WRITE: /001 TB_FILENAM-DATA+555.
(And don't forget to append your ITAB after each read.)
Rob -
Error while writing the data into the file . can u please help in this.
The following error i am getting while writing the data into the file.
<bindingFault xmlns="http://schemas.oracle.com/bpel/extension">
<part name="code">
<code>null</code>
</part>
<part name="summary">
<summary>file:/C:/oracle/OraBPELPM_1/integration/orabpel/domains/default/tmp/
.bpel_MainDispatchProcess_1.0.jar/IntermediateOutputFile.wsdl
[ Write_ptt::Write(Root-Element) ] - WSIF JCA Execute of operation
'Write' failed due to: Error in opening
file for writing. Cannot open file:
C:\oracle\OraBPELPM_1\integration\jdev\jdev\mywork\
BPEL_Import_with_Dynamic_Transformation\WORKDIRS\SampleImportProcess1\input for writing. ;
nested exception is: ORABPEL-11058 Error in opening file for writing.
Cannot open file: C:\oracle\OraBPELPM_1\integration\jdev\jdev\mywork\
BPEL_Import_with_Dynamic_Transformation
\WORKDIRS\SampleImportProcess1\input for writing. Please ensure 1.
Specified output Dir has write permission 2.
Output filename has not exceeded the max chararters allowed by the
OS and 3. Local File System has enough space
.</summary>
</part>
<part name="detail">
<detail>null</detail>
</part>
</bindingFault>Hi there,
Have you verified the suggestions in the error message?
Cannot open file: C:\oracle\OraBPELPM_1\integration\jdev\jdev\mywork\BPEL_Import_with_Dynamic_Transformation\WORKDIRS\SampleImportProcess1\input for writing.
Please ensure
1. Specified output Dir has write permission
2. Output filename has not exceeded the max chararters allowed by the OS and
3. Local File System has enough space
I am also curious why you are writing to a directory with the name "..\SampleImportProcess1\input" ? -
Exporting Crystal .rpt to a fixed length text file
Post Author: jnesbitt
CA Forum: Exporting
I am attempting to write a Crystal report that formats data to be exported to a fixed length text file. Each record will be made up of a number of fields with specific start locations and lengths. Is there any way to set the field start position and field length. I've been able to adjust the character per inch text export parameter to get close, but I can't update the paramete any longer.
How can I reset the "Characters per inch" text export parameter?
Version: Crystal 9.2Hi Jakob
Take a look a this
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/edc2f3c2-0401-0010-8898-acd5b6a94353
Regards
DV -
Download data to Fixed Length Text File
Can anyone share the sample code on how to download data into fixed length text file and place the file in the server directory?
One way i would advice is to declare a text variable and move values using offset.
Eg:
move: <struc>-fld1 to l_text(8),
<struc>-fld2 to l_text+8(3),
<struc>-fld3 to l_text+11(15).
transfer l_text to <file>.
Try this approch and see the result.
Kind Regards
Eswar -
Flat File to XML mapping Problem
I am facing some issues in mapping from flat file to XML. I have not reached to the stage of actually executing the scenario and the problem has not advanced beyond mapping tests.
Following are structures of inbound flat file (as specified in content conversion parameters of sender adapter)
Document Name  MMADealerStatementInbound_MT
Recordset Name  MMADealerStmtInbound_Type
Recordset Structure 
BatchHeader,1,DealerHeader1,,DealerHeader2,,DealerDetail,,DealerAgeing,,Trailer,1
Recordset Sequence  Ascending
Key Field Name  RecordType
Key Field Type  String (Case Sensitive)
Following are structures of Outbound XML file needed
All DealerDetail nodes are lumped together in first DealerStmt nodes. They need to be distributed across many DealerStmt nodes.
Company CompanyName 25
Company CompanyAddress StreetAddress Company Street Address 50
Company CompanyAddress City Company City 40
Company CompanyAddress State Company State 3
Company CompanyAddress ZIP Company ZIP 10
Company CompanyAddress Country Company Country 3
Company RunParams RunDate Statement Run date 8
Company RunParams StmtPeriod Statement Period 20
DealerStmt 0-unbounded DealerNumber 10
DealerStmt 0-unbounded DealerName 35
DealerStmt 0-unbounded DealerAddress StreetAddress Dealer Street Address 50
DealerStmt 0-unbounded DealerAddress City Dealer City 40
DealerStmt 0-unbounded DealerAddress State Dealer State 3
DealerStmt 0-unbounded DealerAddress ZIP Dealer ZIP 10
DealerStmt 0-unbounded DealerAddress Region Dealer Region 4
DealerStmt 0-unbounded DealerRemitToAddress CompanyName Company Name 50
DealerStmt 0-unbounded DealerRemitToAddress StreetAddress1 Street Address 1 50
DealerStmt 0-unbounded DealerRemitToAddress StreetAddress2 Street Address 2 50
DealerStmt 0-unbounded DealerRemitToAddress StreetAddress3 Street Address 3 50
DealerStmt 0-unbounded DealerDetail 0-unbounded DocDate Document Date 8
DealerStmt 0-unbounded DealerDetail 0-unbounded InvoiceNumber Invoice Number 10
DealerStmt 0-unbounded DealerDetail 0-unbounded TransDescription Transaction Description 50
DealerStmt 0-unbounded DealerDetail 0-unbounded TransAmount Transaction Amount 16
DealerStmt 0-unbounded DealerDetail 0-unbounded AmountSign Amount Sign 1
DealerStmt 0-unbounded DealerAgeing CurrentBal Current Balance 15
DealerStmt 0-unbounded DealerAgeing Bal1to31days Balance 1 to 31 Days 15
DealerStmt 0-unbounded DealerAgeing BalOver31 Over 31 days Old 15
DealerStmt 0-unbounded DealerAgeing BalOver61 Over 61 days Old 15
DealerStmt 0-unbounded DealerAgeing BalOver92 Over 92 days Old 15
DealerStmt 0-unbounded DealerAgeing BalOver123 Over 123 days Old 15
Trailer DealersCount 5
Trailer TransCount 10
Trailer TotalAmount 20
Here is the mapping I used for this node.
/ns0:MMADealerStatementOutbound_MT/MMADealerStmtOutbound_Type/DealerStmt/DealerDetail=ifWithoutElse(stringEquals(/ns0:MMADealerStatementInbound_MT/MMADealerStmtInbound_Type/DealerDetail/RecordType=, const()), SplitByValue(/ns0:MMADealerStatementInbound_MT/MMADealerStmtInbound_Type/DealerDetail=))
My email address is [email protected] and i can send some screen shots to understand better.
I need help of XI mapping Gurus.
Thanks
RajeshHI,
Possible mention the source Message/Data Type and Target Data Type and Mapping Rules reuired. Then I think it may be useful to give some hints.
btw , What is the error in Mapping ?
Regards,
Moorthy
Maybe you are looking for
-
Plug ipod in, Windows Vista says "Oh no you didn't!"
Hello! When ever I plug my ipod into my laptop, Windows Vista crases and gives me a BSOD. Also, every time the BSOD gives a different error code; however, when I reboot and log back into Windows I get a message tat says my video drivers crashed. The
-
in services attachment assignment block is there in that assignment block template button . when user click the template button popup will come on that popup pdf documents and msword documents is there when i select the msword document tht details wi
-
Microsoft Word problem with PDF Mac OS
Using Word from Office 2011 under Snow Leopard, if I use the normal 'Print>Save as PDF' the resulting PDF makes my Acrobat Pro 9 hang and I have to force quit it. Saving the files a .doc format makes no difference. I did not have this problem with Of
-
Illustrator CS6 Sneak Peek #1: Pattern Creation
I just stumbled on this video on tv.adobe.com: http://tv.adobe.com/watch/adobe-design-center/adobe-illustrator-cs6-sneak-peek-pattern-cre ation/ Looks like the dark ui is the same tone as in Photoshop.
-
SCCM 2012 r2 Deploy USMT Don´t Restore User State
Hi everybody I am migrating my computers from Win Xp to Windows 8.1, with SCCM 2012 R2 with HardLink, my problem is that USMT does not restore the user state on all my computers, it does in some and not in others. the only difenrecia between the te