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

split tab delimited file

Former Member
0 Likes
1,452

Hiall,

I filled an internal table with the data from a tab delimited file (trought the FM FTP_TOR3).

All my date is in the internal table, but I want to split it now. I tried with the '#' (as ALT + 3), but he doesn 't split the line.

I'm on 4.6, so I cannot use the horizontal_tab as splitter

1 ACCEPTED SOLUTION
Read only

abdulazeez12
Active Contributor
0 Likes
954

IN 4.6 version, no TAB is defined..

so, declare a variable

DATA: gv_tab(9) type c.

and use this gv_tab for splitting..

SPLIT <string> at gv_tab into <str1> <str2>...

This will help u ..

<REMOVED BY MODERATOR>

cheers

Shakir

Edited by: Alvaro Tejada Galindo on Feb 29, 2008 4:42 PM

Hiall,

I filled an internal table with the data from a tab delimited file (trought the FM FTP_TOR3).

All my date is in the internal table, but I want to split it now. I tried with the '#' (as ALT + 3), but he doesn 't split the line.

I'm on 4.6, so I cannot use the horizontal_tab as splitter

5 REPLIES 5
Read only

abdulazeez12
Active Contributor
0 Likes
955

IN 4.6 version, no TAB is defined..

so, declare a variable

DATA: gv_tab(9) type c.

and use this gv_tab for splitting..

SPLIT <string> at gv_tab into <str1> <str2>...

This will help u ..

<REMOVED BY MODERATOR>

cheers

Shakir

Edited by: Alvaro Tejada Galindo on Feb 29, 2008 4:42 PM

Read only

Former Member
0 Likes
954

Hi Shakir,

unfortunately, this won 't work.

This is my code, maybe you can tell me what 's wrong with it ?

data : wa_split(9) type c,

i_string type table of string.

loop at i_data into wa_data.

split wa_data-direct at wa_split into table i_string.

....

endloop.

wa_data-direct contains this as data :

HC8411001#H. Coppens#28.02.2008##USD#A1284#A1284#T

When I do the split, table i_string contains one line with the same data...

Read only

0 Likes
954

Hi Björn Demol ,

All u need to do is:

Data: wa_split x value '09'.

I think it'll solve your problem.

Read only

Former Member
0 Likes
954

While I was searching on this forum on unicode-characters (had a feeling it was something like this), I found a post with practicly the same problem (but with a somewhat bizarre title ), there they told me to use this :

data : c_tab type x value '09'.

as splitter. Apparently, it has something to do with Unix unicode, and the windows # differs from the Unix #.

Problem solved, thanks for the help

(awarded you 10 points for the help )

kr

Björn

Read only

0 Likes
954

Thanks needed this too and right on time.

Br,

Tom Cockaert.