Application Development 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: 

How to read csv \ XLS from FTP server

Hi,

I have the requirement in which i have to read .csv file through ftp . I have done almost but the data coming is not in readable format .

Please suggest .

Regards

Rakesh Kumar Singhdata-output.png

6 REPLIES 6

0 Kudos

Data coming in internal table starting with PK########### .


AntalP
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rakesh,

The file starts with "PK.." which indicates it is a ZIP archive, not a plain CSV file. First you need to extract the archive and then process the file.

Best regards,

Antal

0 Kudos

Could you please let me know how to extract the archive file .

matt
Active Contributor
0 Kudos

Unzipping using ABAP is FAQ. Please search.

0 Kudos

Hi

File in remote system is not ZIP . I would be grateful if any one can share some sample code below is my requirement .

"I have to read .csv file through ftp"

matt
Active Contributor
0 Kudos

You do not need code to read .csv file through ftp. There's no requirement to keep repeating that. Your issue is that once you've got the file, you're having difficulty processing it.

It is abundantly clear that the issue is that your file is not a text file ( csv). In all probability it is an xlsx file (even if it is named .csv). An xlsx file is a zipped file. It just doesn't have a .zip suffix.

You need code to read an xlsx file, as that is what you appear to be receiving. There are plenty of examples of how to do that, if you will search. xls will be considerably harder though.