on 02-23-2009 1:31 PM
Hi, specialists!
I need to get CSV file, using File Adapter. The problem is, that the last column of the file is Comments, so there could be commas, so File adapter thinking that it is a new column.
(I can't change file's structure or use another delimiters instead commas)
Is there any way to skip the last column in file?
Hello,
Try to use row.missingLastfields parameters:
row.fieldNames:IdNum,Name,Group,OrgUnit,Position,Status,ExecuteDate,Mark,Comments,EMPTY1,...,EMPTY_N
where N = max commas in Comment field, i think thant N = 5 is suitable value for any comment.
and other parameters:
row.fieldSeparator: ,
row.endSeparator: 'nl'
row.missingLastfields: ignore
BR,
Dzmitry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dani,
Can you post one or two lines of the source message.
Then it's easier to analyse.
GReets
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Patrick!
Sure I can.
Here is the structure of my csv file:
____________________________________________________________________________
IdNum | Name | Group | OrgUnit | Position | Status | ExecuteDate | Mark | Comments |
Source:
300919669 Fill 1 Customer 111 Smit Smit Done 27/02/2008 75 Failed, low mark
In "Comments" I can get some text with commas.
Here is my xml message in XI:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MarksMT>
<Row>
<IdNum/>
<Name/>
<Group/>
<OrgUnit/>
<Position/>
<Status/>
<ExecuteDate/>
<Mark/>
<Comments/>
</Row>
</ns0:MarksMT>
Edited by: Dani_K on Feb 23, 2009 3:08 PM
Edited by: Dani_K on Feb 23, 2009 3:10 PM
Hi Dan
The best way is using Structure.additionalLastFields:ignore as explained by the fellow SDNers..If its not working for you, then I think you can write a small scripts which replaces commas from the source( of the Comments Column) using "Run operating System command Before Message Processing". Then you will not have comma in the last column...If you want commas to be replaced in the target file, use "Run operating System command After Message Processing" to replace "comma" with ','.
P.S: You know how many commas you will have before the last Column ( Comments Column), so you can by default leave that many occurrence of commas then start replacing them
Hope this is useful
Yes, I tried "additionalLastFields" it didn't help, I've got the:
ERROR in configuration: more elements in file csv structure than field names specified
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Have you tried setting the additionalLastFields parameter to 'ignore'? See [http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6713ec3f914ddee10000000a1553f7/frameset.htm] for details.
Kind regards,
Koen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try the below parameter..
Structure.additionalLastFields:ignore
Regards,
Prakasu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.