简体   繁体   English

如何从目录中读取特定文件?

[英]how can I read a specific file from a directory?

I have a directory with a lot of files, but I only want to read .CSV files.我有一个包含很多文件的目录,但我只想读取.CSV文件。 I passed all the files in the directory to an internal table, and now I want to read these files (read the content of these files to the screen).我把目录下的所有文件传给了一个内表,现在要读取这些文件(把这些文件的内容读到屏幕上)。

Assuming that you use EPS2_GET_DIRECTORY_LISTING as recommended for example in this question , you could just delete all lines of the table that do not end in .csv :假设您按照本问题中推荐的示例使用EPS2_GET_DIRECTORY_LISTING ,您可以只删除表中不以.csv结尾的所有行:

DELETE lt_file_list WHERE name NP '*.CSV'.

Be aware that the CP/NP operators are case-insensitive (this is probably the intende behavior in this case).请注意 CP/NP 运算符不区分大小写(这可能是本例中的预期行为)。

I solve the problem.我解决了这个问题。 When I pass (concatenate) the info into the internal table, I was passing some wrong data.当我将信息传递(连接)到内部表中时,我传递了一些错误的数据。 Thanks.谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM