将文件保存在另一个目录中 [英] Save file in another directory

查看:66
本文介绍了将文件保存在另一个目录中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个java代码来合并所有CSV文件并将数据保存在一个文件中。我必须将合并的文件保存在单独的目录中并删除其他文件。代码工作正常,但我无法将合并的文件移动到另一个目录。我尝试过使用renameTo,将文件写入另一个目录,但只移动了一个空文件。能否请你帮忙?如果提供了代码片段会很有帮助。提前谢谢。

I have written a java code to merge all the CSV files and save the data in a single file. I have to save the merged file in a separate directory and delete the other files. The code works fine but i am not able to move the merged file to another directory. I have tried using renameTo , writing file to another directory but only an empty file gets moved. Could you please help? It would be helpful if a code snippet is provided. Thankyou in advance.

推荐答案

继续尝试,打开你的大脑。我是认真的。



如果你想要至少学习编程的基础知识,你必须自己解决这个问题。你没有用错误显示你的代码,但即使我们知道要修复什么,这对你来说也是一个糟糕的帮助。不要失去你的变化来获得最基本的技能。这种文件琐事是最原始的;如果你没有自己克服它们,你就不会在编程中做任何事情。



我感到沮丧,再想一想。我想鼓励你,而不是沮丧。告诉自己我能做到。



-SA
Keep trying, turn on your brain. I am serious.

The bug must be so trivial that you certainly should fix it by yourself, if you want learn at least the very basics of programming. You did not show your code with the bug, but even if we knew what to fix, it would be a bad help for you. Don't loose your change to get the very basic skills. Such file chores are among the most primitive ones; if you don't overcome them all by yourself, you would not do anything in programming.

I you feel frustrated, think again. I want to encourage you, not frustrate. Tell yourself "I can do it".

—SA


这篇关于将文件保存在另一个目录中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆