Replace String in csv file with file adapter content conversion
Hello experts,
I have a sender file channel to receive csv files from an external server. I can process the csv files but I have a little problem. Since the separator in the csv file is a comma and sometimes a comma also appears in the dates but this time it is not a separator.
Example:
1234,20120123,ABCD,customer, which has a comma in it's name,...
5678,20120123,FGHI,customer without comma,...
My plan is to remove all commas when a blank follows.
My current content conversion looks like this:
Record.fieldNames field1,field2,...
Record.fieldSeparator ,
Record.endSeparator 'nl'
Is there something like Record.fieldReplaceString or something similar which I can use? Or is there perhaps a better way to do this?
I'd appreciate every help I can get here.
Best regards.
Oliver.
Hi Oliver,
I think I've got a solution for you, after all. All you need to do is have your customer name enclosed in quotes, like that:
1234,20120123,ABCD,"customer, which has a comma in it's name",...
Use the rest of FCC configuration as usually. You might also want to have a look at this wiki entry for a configuration example:
http://wiki.sdn.sap.com/wiki/display/XI/FileContentConversion
Moreover, see the description for "NameA.enclosureSign" in the help document below:
http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6830e67f2a6d12e10000000a1553f6/frameset.htm
Hope this helps,
Greg
Similar Messages
-
Can you add to the Lightroom an ability to process several raw files with the same content but with different exposure into the single picture?
Base raw files can be given with exposure bracketing during shooting, for example.
The goal - to get maximum details in darks and lights (if we use the "ligths recovery" or "fill lights" we lose the quality because raw file just have no all required information).
The similar (but not the same, only the idea) thing - is High Dynamic Range Photography in Adobe Photoshop
Thank youThe plugin LR/Enfuse does this already. And of course Photomatix have a plugin available for Lightroom. This essentially amounts to pixel editing, which is beyond the range of Lightroom's metadata editing.
-
Hi
I can't open sql files with file type .pck. They are opened as a package. The icon is a package too. (Worked fine in 4.0)
My settings:
Thanks for any helpThanks, but that doesn't help
To specify it more precisly: I can open such a file, but it is not opened as a sql file. The icons you see above left are the icons of the files (not of the packages).
Greetings
Ovi -
How to process large input CSV file with File adapter
Hi,
could someone recommend me the right BPEL way to process the large input CSV file (4MB or more with at least 5000 rows) with File Adapter?
My idea is to receive data from file (poll the UX directory for new input file), transform it and then export to one output CSV file (input for other system).
I developed my process that consists of:
- File adapter partnerlink for read data
- Receive activity with checked box to create instance
- Transform activity
- Invoke activity for writing to output CSV.
I tried this with small input file and everything was OK, but now when I try to use the complete input file, the process doesn't start and automatically goes to OFF state in BPEL console.
Could I use the MaxTransactionSize parameter as in DB adapter, should I batch the input file or other way could help me?
Any hint from you? I've to solve this problem till this thursday.
Thanks,
Milan K.This is a known issue. Martin Kleinman has posted several issues on the forum here, with a similar scenario using ESB. This can only be solved by completely tuning the BPEL application itself, and throwing in big hardware.
Also switching to the latest 10.1.3.3 version of the SOA Suite (assuming you didn't already) will show some improvements.
HTH,
Bas -
Reading fixed position files with File Adapter
Hi !
I'm trying to use the file adapter to read a file with data in fixed positions .
I cannot get it to work, I'm getting :
[Line=3, Col=133] Expected "${eol}" at the specified position in the native data, while trying to read the data for "element with name Hours", using "style" as "array" and "cellSeparatedBy" as "${eol}", but not found.
Ensure that "${eol}", exists at the specified position in the native data.
and don't understand what the problem is.Sorry I didn't reply sooner.
If you are only interested in the first 133 characters then as you stated you need to put in a dummy filler at the end.
The file adapter is not as smart as you think. What is does is reads the string in a stream, so it gets its command and reads the stream until it hits it, then it gets the next command.
In your situation you said read 1 - 133 thinking it would ignore the other characters in the line. In reality what happens is that it reads the first 133 characters. Assuming that it wasn't looking for a end of line it would then read the next 133 characters. This would include the character you want to ignore, so your pattern would fail.
Good way to think about it is to apply the rules as if you are reading the file your self. In your mind you say read these characters then I want to ignore all the others in the row. You have to tell the file adapter to do the same.
Hope this explains.
cheers
James -
Pick up a specific file with File Sender Adapter.
Hi guys,
I would like to know how I can pick a specific file in a file pool (folder)? I would like to choose this file by name, like FileA or FileB, etc.
Im asking this because I have an asynchronous file scenario (BPM) with a receiver adapter that put the File with a specific name (variable substitution) in a folder.
And I would like to do something like this:
In another asynchronous scenario (BPM), a File sender adapter picks up this specific file (using the name). The correlation is made trough an IDOC that XI receives before pick up the file, this IDOC has payload field with the name of file to be picked.
Is it possible receives the IDOC, read the field with the name of the file to be picked and choose this specific file? In a Sender File Adapter how I can do something like variable substitution like receiver adapter does.
Thanks in advance,
Ricardo.Hi,
<i>Is it possible receives the IDOC, read the field with the name of the file to be picked and choose this specific file? In a Sender File Adapter how I can do something like variable substitution like receiver adapter does.</i>
No this is not possible. The only dynamic thing you can do is use wild card characters like *.
So, maybe you can pick a file like . or AA. and so on...
Regards,
Bhavesh -
Convert XML to flat file with File adapter
Hi all.
Trying to configure a file adapter according to the following link.
http://help.sap.com/erp2005_ehp_04/helpdata/EN/d2/bab440c97f3716e10000000a155106/frameset.htm
What i want it to do is the following.
I have the following incoming message:
<header>
<h_field1></h_field1>
<h_field2></h_field2>
</header>
<data>
<d_field1></d_field1>
<d_field2></d_field2>
<infotext>
<i_field1></i_field1>
<i_field2></i_field2>
</infotext>
</data>
I want this to become a flat file that looks as follow.
h_field1¤h_field2
d_filed1¤d_field2
i_field1¤i_filed2
Every field in each segment should be concatenated with the ¤ char as separator.
I've done the following:
Content Conversions Parameters
Record Structure: header,data,infotext
header.fieldSeparator ¤
data.fieldSeparator ¤
infotext.fieldSeparator ¤
The adapter just gets into wait mode.
Does anybody know why?
BR
KalleHello kalle,
As per your source structure, if you perform FCC on it you should have 2 level hierarchie, Your RecordSet will be your root node.
and the RecordSetStructure is : header,1,data,1,
Since the node infotext is in the data, you can not refer this node and is not appropriate.
<header>
<h_field1/>
<h_field2/>
</header>
<data>
<d_field1/>
<d_field2/>
<infotext>
<i_field1/>
<i_field2/>
< /infotext>
</data>
Change The above strucutre to like this
<header>
<h_field1/>
<h_field2/>
</header>
<data>
<d_field1/>
<d_field2/>
</data>
<infotext>
<i_field1/>
<i_field2/>
< /infotext>
Your RecordSet will be your root node.
and the RecordSetStructure is : header,1,data,1,infotext,1
This resolves your issue..
Regards,
Prasanna -
Reading large file with JCA Adapter in OSB
Hello,
We are searching for a solution how to read large file (>50M) from network drive and deliver it to queue via OSB 11gR4 (10.3.4). The problem is when reading the file with JCA File Adapter. It seems that it cannot handle as large files as we have. The documentation provides a way to bypass file size limitation by using Chunk Read but it seems to require BPEL Process execution which is not possible in our environment. Does anyone know if there are ways to implement this without having BPEL Process?
Our usecase:
read file from network drive -> transfer with OSB -> deliver MQ
Other options than JCA File Adapter can be considered, if anyone can advice...If it's a plain routing use case and no message processing is required then you may simply use OSB's FILE transport instead of JCA adapter. Create a messaging type proxy service and select request message type as "binary". Also enable the content streaming (Disk buffer, compression).
From OSB Dev guide -
Oracle JCA Adapter for FTP and Files – Attachments (large payload support), pre- and post-processing of files, using a re-entrant valve for processing ZIP files, content streaming, and file chunked read are not supported with Oracle Service Bus.
http://download.oracle.com/docs/cd/E17904_01/doc.1111/e15866/jca.htm#BABBICIA
You may also refer -
Reading huge flat file in OSB 11gR1
Regards,
Anuj -
Processing Empty Files with File adapter
Hi..
We are working on SP17....But i couldn't find the option Handling empty files in Sender File adapter...i checked the Adapter Metadata for File adapter under the SWCV- SAP BASIS 6.40 but was unable to search for the word "empty"....
Please suggest....
Regards
PraveshHi
Possibly only from SP 19 in XI and SP 10 in PI.
you have that control. refer this thread
File Content Conversion Problem of not generating empty file -
Receiver File Adapter Content Conversion Problem.
Hi All,
I am getting in receiver file adapter due to content conversion setting. Problem is that all the fields coming in file adapter are optional. In content conversion , i have specified fieldfixedlengths. So whenever any optional field is not present , it fails . How should we handle it? is there any option to declare fields as optional, I know that is the there for sender adapter. But no. of fields is also very large, so putting each and every field as optional is very time consuming.
What should i do?
Ranjeet Singh.Hi Daniele,
Instead of using the standard funciton , i created a UDF for handling this situation.
My logic is UDF is like
//write your code here
int Size = Integer.parseInt(Truncate_Size);
String Return_Value = "";
if (!("".equals(Input)) )
if (Input.length() > Size )
Return_Value = Input.substring(0,Size);
else
Return_Value = Input.substring(0, Input.length());
else
for(int i = 0; i< Size ; i++)
Return_Value = Return_Value + " " ;
return Return_Value;
SO in this case also , it should be able to handle empy source element. But it is not working. -
Receiver File Adapter - Content Conversion
Hi,
I don't quite get this:
I have a structure
<?xml version="1.0" encoding="UTF-8"?>
<AnElement1>
<AnElement2>
Bla bla bla
</AnElement2>
</AnElement1>
I want to convert this to a flat file with a line containing
Bla bla bla
In te receiver file adapter I define the following:
In the 'Content Conversion Parameters'
Recordset Structure : AnElement2
Name Value
AnElement2.addHeaderLine 0
AnElement2.fieldSeparator 'nl'
AnElement2.endSeparator 'nl'
This results in an Empty file each time indicating some error somewhere.
What am I missing?
Thanks
AndreHi Andre,
Just check the link <a href="http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm">File content conversion</a>
Also check out this web log <a href="/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2 to TXT</a>
Is there any error log shown in File adapter ?
Regards,
Keith
Message was edited by: keith thompson -
Attachment of original message in file sender adapter content conversion
Hi,
does anybody know how I can configure a file sender communication channel (with content conversion) so that the original file is added to the XI SOAP message as attachment? Maybe this is just a parameter in "Advanced" tab. (The content conversion itself is not an issue.)
The result should be the "Main Document" (XML-message) and the "original document" as two attachments in the SOAP payload.
The reason for this is that the original file should be archived with the XML message as it was before the XML content conversion of the file sender adapter took place.
Thanks,
Philipporiginal file is added to the XI SOAP message as attachment?
The "Advanced" tab -> additional files added in file adapter should act as the attachment to soap receiver adapter if u select the "Keep Attachments" option in soap receiver communication channel.
What do u want to do in FCC is a bit unclear?
Regards,
Prateek -
Sender File Adapter - Content Conversion
HI Friends,
I got a scenario where I need to convert the File to XML document through Sender file adapter..
My file looks like below.
BATCH1234........
12DASER123142JMM
237DSAFDLKC839890
45SDFLASJ90011
BATCH3455...
132FGAR
SD21352525
BATCH998898...
123145DSRTW
12FSTS
So there is a Header and Body for each record set..
My XML Structure is as follows.
<TimeStructure>
<TimeRecord>
<ControlRec>
<Field1>BATCH </Field1>
<Field2> ...</Field2>
</ControlRec>
<DataRec>
<F1> ...... </F1>
<F2> ...... </F2>
</DataRec>
</TimeRecord>
<TimeRecord>
<ControlRec>
<Field1> BATCH </Field1>
<Field2> ADFAS </Field2>
</ControlRec>
<DataRec>
<F1> ...... </F1>
<F2> ...... </F2>
</DataRec>
</TimeRecord>
</TimeStructure>
The blog <a href="/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem:///people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
is somewhat relevant to my requirement.
But the problem is I have the keyfield "BATCH" for my header file but don't have any <b>key field in the data record</b> of the input file.
Please help me out how to mention the configuration parameters.
Regards,
KumarHi,
If you don't have constant key value for your detail records, then you can not directly get the required xml.
So in this case, you can read all the records in a common Row model, i.e each record will be considered as a one row with all the values, and then split this row with Substring or java functions in the mapping.
Even you can do this in the Adapter module .
If you have key value for each record to identify then you can try with content conversion.
Regards,
Moorthy -
File sender adapter: Content conversion for very deep nested structure
Hi all
I have a file which looks like this
HDOCKET 9800000660980000061911062009AA123456bbWM100012349800000619
DDOCKET_TEST001 4012YAG1
WZOA00000000010000000001
WZOA00000000020000000002
WZOB00000000030000000003
IAAXX000001
IAAXX000002
C0000000000000000000100000000000000000001000000000000000000020000000000000000000300000000000000000004
T2
and my structure is
Header - 1
Detail - 0....Unbounded
Bag - 0.....Unbounded (sub node of detail)
Track - 0.....Unbounded (sub node of detail)
Customer - 0.....Unbounded (sub node of detail)
Trailer - 1
and in the file sender adapter i mentioned the following content conversion setting
HEADER,1,DETAIL,*,Bag,*,Track,*,Customer,*,TRAILER,*
But when i go and see in the monitoring i received the following conversion
<?xml version="1.0" encoding="utf-8" ?>
<ns:MT_REQ xmlns:ns="http://royalmail.com/dd_c">
<HEADER>
<ID>H</ID>
<INT>DD</INT>
<CAR>9899999660</CAR>
<CUS>9899999619</CUS>
<POST>11062009</POST>
<NUMBER>AA123456bbWM10001234</NUMBER>
<ACC>9899999619</ACC>
</HEADER>
<DETAIL>
<ID>D</ID>
<Bag>DOCKET_TEST001</Bag>
<S>4012</S>
<Code>YAG</Code>
<mat>1</mat>
<count/>
<Mixed />
</DETAIL>
<Bag>
<ID>W</ID>
<Zone>ZOA</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
<Bag>
<ID>W</ID>
<Zone>ZOA</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
<Bag>
<ID>W</ID>
<Zone>ZOA</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
</Bag>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Track>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Tracked>
<Customer>
<ID>C</ID>
<OrigCustomer>00000000000000000001</OrigCustomer>
<Field1>00000000000000000001</Field1>
<Field2>00000000000000000002</Field2>
<Field3>00000000000000000003</Field3>
<Field4>00000000000000000004</Field4>
</Customer>
<TRAILER>
<ID>T</ID>
<Count>2</Count>
</TRAILER>
</ns:MT_REQ>
whereas i wanted it like:
<?xml version="1.0" encoding="utf-8" ?>
<ns:MT_REQ xmlns:ns="http://royalmail.com/dd_c">
<HEADER>
<ID>H</ID>
<INT>DD</INT>
<CAR>9899999660</CAR>
<CUS>9899999619</CUS>
<POST>11062009</POST>
<NUMBER>AA123456bbWM10001234</NUMBER>
<ACC>9899999619</ACC>
</HEADER>
<DETAIL>
<ID>D</ID>
<Bag>DD_TEST001</Bag>
<S>4012</S>
<Code>egg</Code>
<mat>1</mat>
<count/>
<Mixed />
<Bag>
<ID>W</ID>
<Zone>zzz</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
<Bag>
<ID>W</ID>
<Zone>zzz</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
<Bag>
<ID>W</ID>
<Zone>zzz</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
</Bag>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Track>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Tracked>
<Customer>
<ID>C</ID>
<OrigCustomer>00000000000000000001</OrigCustomer>
<Field1>00000000000000000001</Field1>
<Field2>00000000000000000002</Field2>
<Field3>00000000000000000003</Field3>
<Field4>00000000000000000004</Field4>
</Customer>
</DETAIL>
<DETAIL>
<ID>D</ID>
<Bag>DD_TEST002</Bag>
<S>4012</S>
<Code>egg</Code>
<mat>1</mat>
<count/>
<Mixed />
<Bag>
<ID>W</ID>
<Zone>zzzzzz</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
<Bag>
<ID>W</ID>
<Zone>ZOA</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
<Bag>
<ID>W</ID>
<Zone>zzz</Zone>
<Item>0000000001</Item>
<Number>0000000001</Number>
</Bag>
</Bag>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Track>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Tracked>
<Customer>
<ID>C</ID>
<OrigCustomer>00000000000000000001</OrigCustomer>
<Field1>00000000000000000001</Field1>
<Field2>00000000000000000002</Field2>
<Field3>00000000000000000003</Field3>
<Field4>00000000000000000004</Field4>
</Customer>
</DETAIL>
<TRAILER>
<ID>T</ID>
<Count>2</Count>
</TRAILER>
</ns:MT_REQ>
i.e. i need all Bag ,Track and Customer inside detail tag.
could anyone help me in this..i've already searched SDN and got some link as useful but none of them were totally related.
Regards
NainaNaina
Pls. check my forum link, i had the single level hierarchy XML file which I converted into nested structure & then into flat file.
File Conversion in Rec File Adapter with subnodes
This can give you an idea how to go ahead. Let me know in case you need any more info about this. -
File Receiver Adapter - Content Conversion
Dear All,
We are using <b>DB to file Scenario</b>.We are using File Content conversion to get a File Comma Separated.
Data is picked up from the DB and our payload before getting in to File adapter is given below.
<?xml version="1.0" encoding="UTF-8" ?>
<ns6:AssoInfo_MT xmlns:ns6="urn:NDB2File2DB">
<AssoInfoList>
<AssoInfoNode>
<Name>ABCX</Name>
<ID>31154</ID>
<Salary>10000.0</Salary>
</AssoInfoNode>
<AssoInfoNode>
<Name>ASDAS</Name>
<ID>18978</ID>
<Salary>10000.0</Salary>
</AssoInfoNode>
</AssoInfoList>
</ns6:AssoInfo_MT>
In File content conversion we are giving
<b>AssoInfoNode.addHeaderLine = 0
AssoInfoNode.fieldSeparator = ,
AssoInfoNode.endSeparator = 'nl'</b>
We are getting output as
<b>ABCX,ASDAS</b>
But the <b>expected</b> output is
ABCX,31154,10000.0
ASDAS,18978,10000.0
What change we need to do in our File Receiver Adapter configuration.
Regards,
VedavyasHello,
Test without these 2 options :
AssoInfoNode.addHeaderLine = 0
AssoInfoNode.endSeparator = 'nl'
I think your problem is with the "endSeparator", it is not necessary.
A new line is created for each new AssoInfoNode automaticaly.
Regards,
Chris
Maybe you are looking for
-
How can I change the order of html form data submitted to me via email?
I am having customers contact me via an html form posted on my website using the "sendtoemail" command. When I receive the data in an e-mail it is not presented in the order it appears on the web page and I can't seem to find out what dictates the o
-
my iphone 3g is stuck on the connect to itunes mode and it wont show up on itunes. itunes hasnt even detected it on recovery mode. what do i do i really need my phone.. please help
-
Hi, Is assignment of SAP logical system to client mandatory... I understand that we can give dummy names like SAP_A as logical systems but is it mandatory to assign them to clients.. I think Idoc can be sent to the respective SAP system through ports
-
CS5: File size issue?!
I am currently trying Photoshop CS5 and found some issues regarding memory and file size. One issue shows up as following: Opened a 21MP photo via Camera Raw as Smart Object, used Noise Reduction Filter and saved this one Layer image as PSD without m
-
I just got a new Nano 3G a few days ago. Today I got no sound when I hooked the nano up to my cassette adapter. Hmmm. So I tried it at work with my headphones. No sound. Well I read a post here that says to press the center and menu buttons together.