Skip to content

Commit 1dde635

Browse files
authored
docs
1 parent 14ad31f commit 1dde635

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ Legend
88
+ : added
99
- : removed
1010

11+
v2.5.1, 2025-?
12+
------------------
13+
+ new parameter skip_lines_starting_with to allow skipping "commented" lines
14+
+ string i_renames now also support `,` delimiter
15+
1116
v2.5.0, 2025-06-10
1217
------------------
1318
! BREAKING: move types to zif_text2tab interface #27

docsite/docs/03-parsing-options.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ zcl_text2tab_parser=>create( lt_container )->parse(
3535
* JOHN 02.02.1995
3636
```
3737

38-
Renames can be also passed as a string in this format: `'field_to_rename:new_name;another_field:another_new_name'`. Coding convenience is important ;)
38+
Renames can be also passed as a string in this format: `'field_to_rename:new_name, another_field:another_new_name'`. `;` and `,` are supported as separators. Coding convenience is important ;)
3939

4040
```abap
4141
zcl_text2tab_parser=>create( lt_container )->parse(
@@ -134,7 +134,9 @@ JOHN 01.01.1990
134134
Now we should call the factory method like this and the first line is interpreted as a comment:
135135

136136
```abap
137-
zcl_text2tab_parser=>create( i_pattern = ls_birthday i_begin_comment = '*' ).
137+
zcl_text2tab_parser=>create(
138+
i_pattern = ls_birthday
139+
i_begin_comment = '*' ).
138140
```
139141

140142
The char '*' must have the first position in the text line. Otherwise it isn't interpreted as a comment.
@@ -146,3 +148,22 @@ Name Date of birth <<< containes spaces
146148
NAME BIRTHDAY
147149
JOHN 01.01.1990
148150
```
151+
152+
### Within-data comments
153+
154+
Also the data can contain commented lines. They can be skipped if started with a char passed with `i_skip_lines_starting_with` param. This can be useful for human-friendly data grouping.
155+
156+
```abap
157+
zcl_text2tab_parser=>create(
158+
i_pattern = ls_birthday
159+
i_skip_lines_starting_with = '#' ).
160+
```
161+
162+
```text
163+
NAME BIRTHDAY
164+
# Managers <<< will be ignored
165+
John 01.01.1990
166+
# Employees <<< will be ignored
167+
Anna 01.01.1990
168+
```
169+

0 commit comments

Comments
 (0)