Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Get data from line separated by ;

Former Member
0 Likes
654

Hi,

I really need your help with this!

I have a csv file with ; as separation mark and I need to do 2 things :

1) First line is the header which looks like :

STDTOT;CT;INFO; ;DFULOC;28/07/08;04/08/08;11/08/08;18/08/08;25/08/08;01/09/08;08/09/08; etc.

There is no ';' after the last date (end of the line).

I need to capture the dates (it can be very long) and put them in a table with single column.

2) The remaining lines are items :

XXXDDDDD;AAAADD;GGGGG;HHHH;;;50.3;60.8;89.1;90.2

YYYDDDD;GGFFGF;FFFFFF;GTYYJ;;;;10.6;12.3;13.5;18.9

etc.

I need to take in account every line where there is a qty in order to find the first and last date of the header.

For ex. item 1:

XXXDDDDD start date = 11/08/08 & end date = 01/09/08.

If I can find out the way to see in which position the first and last quantity are then I can easily point it to the table with dates did in section 1).

I know that this is a very difficult task but any good suggestion is always welcomed!

Can anyone help me?

Thanks!

Tarick.

1 ACCEPTED SOLUTION
Read only

peter_ruiz2
Active Contributor
0 Likes
600

hi,

Use SPLIT.

SPLIT line AT ';' INTO TABLE itab1.

after execution, itab1 will look like this base from your example.

STDTOT

CT

INFO

DFULOC

28/07/08

04/08/08

11/08/08

18/08/08

25/08/08

01/09/08

08/09/08

regards,

Peter

Hi,

I really need your help with this!

I have a csv file with ; as separation mark and I need to do 2 things :

1) First line is the header which looks like :

STDTOT;CT;INFO; ;DFULOC;28/07/08;04/08/08;11/08/08;18/08/08;25/08/08;01/09/08;08/09/08; etc.

There is no ';' after the last date (end of the line).

I need to capture the dates (it can be very long) and put them in a table with single column.

2) The remaining lines are items :

XXXDDDDD;AAAADD;GGGGG;HHHH;;;50.3;60.8;89.1;90.2

YYYDDDD;GGFFGF;FFFFFF;GTYYJ;;;;10.6;12.3;13.5;18.9

etc.

I need to take in account every line where there is a qty in order to find the first and last date of the header.

For ex. item 1:

XXXDDDDD start date = 11/08/08 & end date = 01/09/08.

If I can find out the way to see in which position the first and last quantity are then I can easily point it to the table with dates did in section 1).

I know that this is a very difficult task but any good suggestion is always welcomed!

Can anyone help me?

Thanks!

Tarick.

3 REPLIES 3
Read only

Former Member
0 Likes
600

Tarick

Try using SPLIT statement....

Thanks,

Amol Lohade

Read only

peter_ruiz2
Active Contributor
0 Likes
601

hi,

Use SPLIT.

SPLIT line AT ';' INTO TABLE itab1.

after execution, itab1 will look like this base from your example.

STDTOT

CT

INFO

DFULOC

28/07/08

04/08/08

11/08/08

18/08/08

25/08/08

01/09/08

08/09/08

regards,

Peter

Read only

Former Member
0 Likes
600

To get the data in an internal table use FM

ALSM_EXCEL_TO_INTERNAL_TABLE

The internal table will have each line of excel in each row of itab

Then Loop at this internal table

Use SPLIT command at each row to get individual elements.

Hope this helps!

Regards,

Prashant