IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

FlexText Splitting without loosing the separator Options · View
Wolfgang Homburg
Posted: Friday, December 1, 2017 1:19:18 PM
Rank: Newbie

Joined: 12/1/2017
Posts: 3
Location: Kassel, Germany
(I just started to work with MapForce ...)

I got a CSV-File (; is the separator) with following format (see attachment):
The fist line contains some column headings. The next lines have the same format and contain the data. They look as follows:
"SHEABR;4711;135580105;some text;1;2;8;Adam 1;03/08/1959;1038988;1;;Adam 2;03/08/1959;1238988;;1;Adam 3;03/08/1959;7038988;1;;..."

The items up to the first "Adam" are of no interest. After that some blocks of 5 items each follow. The final goal of "MapForcing" that file is a file, which has these "5 item blocks" as lines.
With FlexText I managed to
1. Split of the first line
2. Cut of the part of no interest from each line
3. Split the "5 item blocks"

To achieve goal 3, I used a regular expression. The problem is, that the data matching the regular expression is lost. Is there a way to avoid this?

File Attachment(s):
PauschForum.txt (2kb) downloaded 270 time(s).
forum_pausch.mft (3kb) downloaded 193 time(s).
shortPauschForum.txt (1kb) downloaded 231 time(s).


K101
Posted: Friday, December 1, 2017 2:10:16 PM
Rank: Advanced Member

Joined: 2/27/2009
Posts: 558
Since you already created a FlexText configuration, why not attach that as well so we can see what you tried?

Did you create a mapping also? If so, please attach that as well.
Wolfgang Homburg
Posted: Monday, December 4, 2017 11:31:08 AM
Rank: Newbie

Joined: 12/1/2017
Posts: 3
Location: Kassel, Germany
Please find attached the FlexText configuration. However, it refers to the simplified CSV-File shortPauschForum.txt.
island
Posted: Tuesday, December 5, 2017 9:53:33 AM
Rank: Newbie

Joined: 10/28/2002
Posts: 1,283
Location: AT
There is no way to avoid the loss with the regex split approach. I would suggest something different. Use the mapping. flextext and xsd schema to get the file into a much more workable format which will be more easy to work with i.e.

Code:

Adam 1;03/08/1959;1038988;1;
Adam 2;03/08/1959;1238988;;1
Adam 3;03/08/1959;7038988;1;
Adam 4;03/08/1959;8038988;1;
Adam 5;03/08/1959;9038988;1;
Adam 6;03/08/1959;2038988;;1
Adam 7;03/08/1959;3038988;1;
Adam 8;03/08/1959;4038988;1;
Adam 9;03/08/1959;5038988;1;
Adam 10;03/08/1959;6038988;1;
Eve 1;03/08/1959;1038988;1;
Eve 2;03/08/1959;1238988;;1
Eve 3;03/08/1959;7038988;1;
Eve 4;03/08/1959;8038988;1;
Eve 5;03/08/1959;9038988;1;
Eve 6;03/08/1959;2038988;;1
Eve 7;03/08/1959;3038988;1;
Eve 8;03/08/1959;4038988;1;
Eve 9;03/08/1959;5038988;1;
Eve 10;03/08/1959;6038988;1;
Bill 1;03/08/1959;1038988;1;
Bill 2;03/08/1959;1238988;;1
Bill 3;03/08/1959;7038988;1;
Bill 4;03/08/1959;8038988;1;
Bill 5;03/08/1959;9038988;1;
Bill 6;03/08/1959;2038988;;1
Bill 7;03/08/1959;3038988;1;
Bill 8;03/08/1959;4038988;1;
Bill 9;03/08/1959;5038988;1;
Bill 10;03/08/1959;6038988;1;




File Attachment(s):
test_mapping.zip (4kb) downloaded 228 time(s).

island attached the following image(s):
mapping.png

Wolfgang Homburg
Posted: Thursday, December 7, 2017 8:57:16 AM
Rank: Newbie

Joined: 12/1/2017
Posts: 3
Location: Kassel, Germany
Sounds great, I'll try that.
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.