如何将字符串列表转换为csv格式

时间:2012-06-13 06:49:26

标签: java csv

我想将字符串的Treeset(在java中)转换为csv格式。

samle treeset:

    Desktop/netbeans-7.1.2.desktop
    Downloads/jasper.jar
    Downloads/may_2012_report
    netbeans-7.1.2-ml-linux.sh
    ppt/Ankit_PPT/cloudppt.ppt
    ppt/Ankit_PPT/dataplacement.pptx
    ppt/vir047_wh06.ppt
    pro1
    rough
    struts2
    struts2-jquery-plugin-3.3.0.jar

示例csv格式:

    Desktop,0,Desktop
    Desktop/netbeans-7.1.2.desktop,Desktop,netbeans-7.1.2.desktop
    Downloads,0,Downloads
    Downloads/jasper.jar,Downloads,jasper.jar
    Downloads/may_2012_report,Downloads,may_2012_report
    netbeans-7.1.2-ml-linux.sh,0,netbeans-7.1.2-ml-linux.sh
    ppt,0,ppt
    ppt/Ankit_PPT,ppt,Ankit_PPT
    ppt/Ankit_PPT/cloudppt.ppt,ppt/Ankit_PPT,cloudppt.ppt
    ppt/Ankit_PPT/dataplacement.pptx,ppt/Ankit_PPT,dataplacement.pptx
    ppt/vir047_wh06.ppt,ppt,vir047_wh06.ppt
    pro1,0,pro1
    rough,0,rough
    struts2,0,struts2
    struts2-jquery-plugin-3.3.0.jar,0,struts2-jquery-plugin-3.3.0.jar

此致 ANKIT

0 个答案:

没有答案