Conversion of contents of file..Hierarchical file.....
Hi experts
I have a source file which will look like the following
ZHD|D0039001|G|CAPG|D|NEEB|20090420093324
ZPD|20090417||B|4191|
GSP|_A
PCI|1
SCI|0151
DPC|00261|0.0022672942446
SCI|0430
DPC|00043|0.0032362480141
DPC|00109|0.0031630587104
SCI|0105
ZPT|5087|1426342443
the occurrences of ZHD and ZPD are 1..The GSP,PCI,SCI,DPC can be of 0-unbound.ZPT will be of 1 occurence.What will be my file content conversion will look like.....This is a file-to-idoc scenario.I then need to post it to an idoc.
Can anyone will tell me what my file content conversion will look like!!
Hi Satish
I will use the key field..thats fine........I will modify my query a little bit....
ZHD|D0039001|G|CAPG|D|NEEB|20090420093324
ZPD|20090417||B|4191|
GSP|_A
PCI|1
SCI|0151
DPC|00043|0.0032362480141
DPC|00210|0.0012182234860
SCI|0188
DPC|01191|0.0011982322452
DPC|01192|0.0031933347404
SCI|0244
DPC|00040|0.0030303783518
DPC|00206|0.0013075551158
SCI|0393
ZPT|5087|1426342443
If you look at the file little intently, you will find that all the DPC values and SCI values are not happenning in clustered way like all the DPC values of the file are not grouped together...Rather DPC values are grouped in accordance with SCI......I am giving you the relation between DPC and SCI....Against one SCI values there are multiple DPC values .....And this combination of
DPC and SCI can happen multiple times.....This is actually the requirement..
Can this be done using file content conversion!!!...Any help is highly appreciated...
Similar Messages
-
File Content Conversion i.e Flat file 2 Flat file
Hi guys,
I am new 2 SAP XI
and i am trying 2 do "Flat File To Flat File".
Input File contains following data:
Name:varun
Surname:rajaraman
Address:B-2
Employee no:8204
i.e Each Data is in separate Row.
Output File Should contain the following data:
I am varun rajaraman staying at B-2 bearing employee no. 8204.
(name,surname) (address) (Employee No.)
i.e data should be in a single row.
So, i have a problem of reading the data from input file i.e data from each row and transfering it into output file along with which i need 2 insert "i am " ,"staying at", etc.
pls tell me the procedure in detail.
Thanks and regards
santhosh rajaramanHi,
Check this links for file content convertion.
File content conversion sites
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Regards,
Phani
Reward Points if Helpful -
File-Sender: Verification of file content during file content conversion
Hello,
I have a question regarding file verification when using the file-sender adapter.
I got a flat file (.csv) that I convert into XML with the file-sender adapter and file-content-conversion.
In the file there is a column RecTyp that is my KeyFieldValue. Possible values for RecTyp are B, D, U, T.
So far so good. All this works perfectly.
If (due to an error) there is another value in RecTyp than the 4 mentioned above (B;D;U;T) the file adapter ignores this row today. And here begins my issue:
I want to change this behavior. That means in detail, I want to check if there is another value in my KeyFieldValue RecTyp than specified. If this is the case an exception should be thrown. The whole message should not be delivered.
We had the idea to use the module-processor for this verification .
But may be there are other suggestions. Or may be some one can provide an appropriate module that is already written, etc .
Does anyone have an idea?
Kind regards,
TobiasHi,
It is better to pick the file in generic way i.e Row by Row and then go with the validation with the help of Adapter Modules or in the Mapping.
For more-
/people/sravya.talanki2/blog/2005/08/16/configuring-generic-sender-file-cc-adapter
Thanks,
Moorthy -
Skipping the content conversion if the input file is an xml file.
Hi,
My source folder contains both text files and xml files.
I want to skip the content conversion if the input file is an xml file and the same Content conversion as to work if the input file is a text file.
Is there any way to achieve this?
Regards
DiviaHi,
I think u hv to create 2 separate Communication Channels.............. 1 for XML (without Content Conversion), & other for TXT with Content Conversion.
In 1st CC give file name as *.xml & in 2nd give file name as *.txt
Thanks,
Maheshwari -
CUT parameter in the content conversion of the Receiever File Adapter
Hi,
I have mentioned the CUT parameter in content conversion in the receiver file adapter, it is working fine. The only problem is it inserts one blank line in the file. Is there any way to remove this blank line other than running script.
Your help is appreciated.
Thanks,
PrateekHi Prateek,
If your File Content COnversion is Row Level(not in field level)?
i.e fieldSeparator = 'nl' if so try like this-
endSeparator = 0
Hope it will remove the blank line.
Regards,
Moorthy -
how can I saved the ipad isms conversation in a iMac file to be able of deleting them from the ipad?
Hi Aurea,
One way of saving your sms conversations so that you can then delete them from your iPad would be to back up the contents of your iPad using either iTunes or iCloud. See these articles -
Create and delete iPhone, iPad, and iPod touch backups in iTunes - Apple Support
iCloud: iCloud storage and backup overview
Thanks for using Apple Support Communities.
Best,
Brett L -
CONVERSION FROM ANSI ENCODED FILE TO UTF-8 ENCODED FILE
Hi All,
I have some issues in conversion of ANSI encoded file to utf encoded file. let me tell you in detail
I have installed the Language Support for Thai Language on My Operating System.
now, when I open my notepad and add thai character on the file and save it as ansi encoding. it saves it perfectly and also I able to see it on opening the file again.
This file need to be read by my application , store in database and should display thai character on jsp after fetching the data from database. Currently it is showing junk character on jsp reason being that my database (UTF8 compliant database) has junk data . it has junk data because my application is not able to read it correctly from the file.
If I save the file with encoding as UTF 8 it works fine. but my business requirement is such that the file is system generated and by default it is encoded in ANSI format. so I need to do the conversion of encoding from ANSI to UTF8 . so Any of you can guide me on the same how to do this conversion ?
Regards
Gaurav NigamGuessing the encoding of a text file by examining its contents is tricky at best, and should only be done as a last resort. If the file is auto-generated, I would first try reading it using the system default encoding. That's what you're doing whenever you read a file with a FileReader. If that doesn't work, try using an InputStreamReader and specifying a Thai encoding like TIS-620 or cp838 (I don't really know anything about Thai encodings; I just picked those out of a quick Google search). Once you've read the file correctly, you can write the text to a new file using an OutputStreamWriter and specifying UTF-8 as the encoding. It shouldn't really be necessary to transcode files like this, but without knowing a lot more about your situation, that's all I can suggest.
As for native2ascii, it isn't for encoding conversions. All it does is replace each non-ASCII character with its six-character Unicode escape, so "voilá" becomes "voil\u00e1". In other words, it avoids the problem of character encodings by converting the file's contents to a form that can be stored as ASCII. It's mainly used for converting property or resource files to a form that can be read by the Properties and ResourceBundle classes. -
Uploading the contents of file into custom table
Hi ,
I have a req where in i want to put the contents of the file into the Z table . I have taken a file upload UI element and in that i have taken 4 attributes as file name f, file type ,file size and file contents and binded this file contents to the data property of the UI element. Now with out explicitly defining the fields i want to put all this content of file into the Z table created for any file created or if i could put the whole text file into that table so that any one could see that file even though its not saved in the desktop for that user.
Can any one help me out?Yes i am converting it inot the lstring using the same FM which you have given. I have to store the total file but the only doubt is like if its a input field how could i save a file form. Can you please check the code i want to save the total file into the table.
DATA lo_nd_upload TYPE REF TO if_wd_context_node.
DATA lo_el_upload TYPE REF TO if_wd_context_element.
data i_data TYPE STANDARD TABLE OF string.
DATA ls_upload TYPE wd_this->Element_upload.
data lv_field type string.
data lt_file type TABLE OF ZFILE_UPLOAD.
data ls_file LIKE LINE OF lt_file.
data l_xstring type xstring.
data fields TYPE string_table.
data l_String type string.
navigate from <CONTEXT> to <UPLOAD> via lead selection
lo_nd_upload = wd_context->get_child_node( name = wd_this->wdctx_upload ).
@TODO handle non existant child
IF lo_nd_upload IS INITIAL.
ENDIF.
get element via lead selection
lo_el_upload = lo_nd_upload->get_element( ).
@TODO handle not set lead selection
IF lo_el_upload IS INITIAL.
ENDIF.
get all declared attributes
lo_el_upload->get_static_attributes(
IMPORTING
static_attributes = ls_upload ).
DATA lv_file_contents TYPE wd_this->Element_upload-file_contents.
navigate from <CONTEXT> to <UPLOAD> via lead selection
@TODO handle non existant child
IF lo_nd_upload IS INITIAL.
ENDIF.
get element via lead selection
lo_el_upload = lo_nd_upload->get_element( ).
alternative access via index
lo_el_upload = lo_nd_upload->get_element( index = 1 ).
@TODO handle not set lead selection
IF lo_el_upload IS INITIAL.
ENDIF.
get single attribute
lo_el_upload->get_attribute(
EXPORTING
name = 'FILE_CONTENTS'
IMPORTING
value = l_xstring ).
for text file conversion we have to FM
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
FROM_CODEPAGE = '8500'
IN_XSTRING = l_xstring
OUT_LEN =
IMPORTING
OUT_STRING = l_string.
SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE i_data.
LOOP AT i_data INTO l_string.
SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
read TABLE fields into lv_field index 1.
endloop.
ls_upload will contain all the file details
ls_file-file_size = xstrlen( ls_upload-file_contents ) * lv_float .
ls_file-file_name = ls_upload-file_name.
ls_file-file_type = ls_upload-file_type.
ls_file-file_contents = ls_upload-file_contents.
insert ZFILE_UPLOAD FROM ls_file.
thanks -
apple loops for garageband pack doesn't show the folder content (loops, files...) in ableton live suite 8 library browser, but I can see all the loops in the folder from finder. how can i fix this? help please.
Thanks Barney, I tried that but all that comes up in Spotlight are the log files that show the file paths! I don't know how Steam works. Are all the files held by Steam on their server perhaps?
-
How to edit the content.opf file of a FXL EPUB?
I'm exporting a fixed layout epub and I cannot find out where the content.opf file is and how to edit it. I'm trying to do the same thing that was done here: Indesign CC 2014 Fixed Layout export
Can anyone point me in the right direction? I've googled to no end!
Thanks,Please follow these steps to edit your EPUB:
1. Download Sigil https://code.google.com/p/sigil/downloads/list
2. Open your EPUB in this editor.
3. In the book browser view on your left, look up for content.opf file. Edit this file and save your EPUB.
Regards,
Pooja
InDesign Engineering -
The online conversion of my pdf file to word did not correctly convert the tables and certain other formatting. I wish to obtain a refund.
Hi yammyamm,
I'm sorry that your conversion didn't work out for you. Please contact Adobe Customer Support via phone or chat, and an agent will be able to process that cancellation/refund for you. Here is the contact information: Contact Customer Care
Best,
Sara -
Portlet backing file vs content backing file
Hi,
could someone explain the differences between a "portlet backing file" and a "content backing file". Both are properties available on a portlet.
Thx
EmmanuelAccording to the documentation, here is the difference:
Scoping and Backing Files
The difference between having a backing file as part of <netuix: portlet backingfile =some_value> or part of <netuix: jspContent backingfile=some_value> is related to scoping.
For example, if you have the backing file on the portlet itself, you can actually stop the portlet from rendering. If the backing file is at the jspContent level, the portlet portion of the control tree has already run; you use this implementation to run processes that are specifically for the JSP in the portlet.
See http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portlets/building.html#wp1077130 for more info.
Brad -
Sender File (FCC) - Content of File into single XML Tag
Hi,
Input file
This is Line1
This is Line2
Expected Sender File adapter FCC into XML
<Document>
.<File>
..<Content> This is line 1 This is line2</content>
.</File>
</Document>
FCC is giving the following output with the below config,
File.fieldNames = Content
File.fieldSeparator = '0x1A' (HexaDecimal rep for EndOfFile)
<Document>
.<File>
..<Content>This is line 1</content>
..<Content>This is line 2</content>
.</File>
</Document>
How can i read the complete file into a single XML tag?
I am aware of other options (AdapterModules or Javamapping). But i want to keep it simple to FileAdapter using FCC or using MessageTransformBean (if possible)
-SMFCC donse't work here, So i wrote a simple Java map inside Execute method to convert the content to the required format.
public void execute(InputStream in, OutputStream out) throws StreamTransformationException{
StringBuilder sb = new StringBuilder();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
while ((line = reader.readLine()) != null) {
sb.append(line).append("\r\n");
} finally {
in.close();
After i had the input string, i formatted it to get the required output as XML ...
<Document>
.<File>
..<Content> This is line 1 This is line2</content>
.</File>
</Document> -
Read content of file which is ZIPed
I need to read contents of a file which is present in ZIP file.
The zip file is present on online server. I am able to get the Zip Input stream for the Zip file and also able to retrive the file names which are present but when I am trying to retrive the content of file is get a String which has only the file names of the zip. Please suggest what to do.
Following is my Code.
// aConn.getInputStream() Gives me access to Zip file present on online Server
ZipInputStream fileIn = new ZipInputStream(aConn.getInputStream());
anEntry = inputStream.getNextEntry();
if (anEntry != null) {
String filename = arEntry.getFilename();
byte[] b = new byte[2024];
fileIn.read(b);
sb.append(b.toString());
}Reading an input stream into an array of bytes and then calling toString() on that byte array isn't going to give you the contents of the input stream meaningfully. For one thing it might not even be textual data. And secondly that's not how you get textual data.
A better approach would probably be to get the number of bytes of the given entry from the ZipEntry.getSize method, create a byte array of that size, load only that many bytes, and then (if you're sure it's text data) send the byte array to a String constructor. Or you could use a java.io.ByteArrayOutputStream for that. Note that you'll need to know the character encoding for this. -
Content.css file in Web page composer
Below are the styles I am using in a JSP file for Web page composer layout. Not sure where to add the CSS file.
Is it etc/wpceditor/css/runtime?
How do I include it in my jsp? and Do I hve to restart portal after I upload the css file?
table.wpc_3c_outertable
tr.wpc_3c_outertable_row
tr.wpc_hidden_row
td.wpc_sdn_20_46_34_col1
td.wpc_sdn_20_46_34_col2
td.wpc_sdn_20_46_34_col11
td.wpc_sdn_20_46_34_col12
tr.wpc_sdn_20_46_34_col1_row
td.wpc_sdn_20_46_34_col21
tr.wpc_sdn_20_46_34_col2_row
table.wpc_3c_innertable
table.wpc_3c_innertable2
td.wpc_mainarticle1, td.wpc_footer
table.wpc_3c_outertable
table.wpc_3c_innertable
table.wpc_3c_innertable2
td { background-color: #FF9933; border: 1px solid #C0C0C0; }
=====================
will my layout work. If I add the following code to the content.css file?
content.css
table.wpc_3c_outertable, table.wpc_3c_innertable, table.wpc_3c_innertable2
tr.wpc_3c_outertable_row, tr.wpc_sdn_20_46_34_col1_row, tr.wpc_sdn_20_46_34_col2_row { vertical-align: top; }
td.wpc_sdn_20_46_34_col1
td.wpc_sdn_20_46_34_col2
td.wpc_sdn_20_46_34_col11
td.wpc_sdn_20_46_34_col12
tr.wpc_hidden_row
td.wpc_mainarticle1, td.wpc_footerVishal -
First... we are all new to WPC!
Second, no I don't think you need to create a new container. I think that you just need to add the swf type as an allowed type for the container.
So...
Figure out which container you are trying to add the flash file to (as you mentioned, A1, A2, etc).
Navigate to:
Sys Admin --> Sys Config --> Knowledge Mgt --> Content Mgt --> WPC --> Containers.
Edit the container you want to use.
There will be a box named Allowed Mime Types.
In here, select the "swf" mime type (make sure the check box is checked). Then Save.
At my company, we had the WPC ramp up from SP12, and are now on SP13.
I'm not sure what you get if the first time you had WPC is SP13, but for us I see two default A1 (and A2...B1..C4...etc) containers -- one that has "default" in the name and one that has "def" in the name. From what I see, SP13 WPC uses the one with "def" in the name, not "default". So, make sure you modify the one with "def" in the name.
After you make this change, you should see "swf" in the list inside the container when you are editing a page.
Is this clearer? I wish I could attach a screenshot.
Maybe you are looking for
-
What is the deal with System Reset/Refresh in Windows 8.1?
Either this is a serious defect with the Windows Store-provided update for Windows 8.1 or Microsoft has done this intentionally but doing an update to Windows 8.1 from the Windows Store-provided service nukes your ability to use System Reset/Refresh.
-
I have an lg smart TV. I also just bought an apple ipad air,Wi-Fi Cellular 16GM I've signed up the air to itunes and just purchased a movie on the ipad air. I was able to stream the movie on my air and my pc, which is of course wirelessly connected
-
Drawing 2D graphics with no frame or no panel ?
Hi, I would like to know if it is possible to draw 2D graphics directly over the OS(windows2002) ? like drawing a rectangle over the desktop without any JPanel or JFrame. cheers, sletourne
-
hi that's my problem: i tried to load a dvd today. nothing works. the disk doens't load: it stays half inside half outside, I can not put it inside, like if a disk was already indise, but there is not any one. can some one help me please? thanks a.
-
Best MacBook Pro for video editing
Any suggestions - I would like to purchase a MacBook Pro but I want to some video editing with it -which is the one to look at? Thanks