[英]How to publish a list of strings (of slash seperated values) to Amazon S3 as CSV?
I have a list of Strings as follows->我有一个字符串列表如下->
List<String> x=new ArrayList<String>();
Each string inside the list is of the following format -(They are slash separated)
String 1-Name/City/Age/Hobbie
String 2-Ross/Sydney/35/Painting
String 3-Joey/Wellington/40/Dancing
and so on
How to publish these strings to a S3 Bucket as a csv file?如何将这些字符串作为 csv 文件发布到 S3 存储桶?
There should be four columns in the sheet Name,City,Age,Hobbie工作表中应该有四列 Name,City,Age,Hobbie
First you need to create.csv file from your input data.首先,您需要从输入数据中创建.csv 文件。 You can do it by writing your own logic to separate string and then writing it to file with the help of
PrintWriter
class of java.io
package or you can you third party library which makes your life easy. You can do it by writing your own logic to separate string and then writing it to file with the help of
PrintWriter
class of java.io
package or you can you third party library which makes your life easy. Here is the list of libraries you can use.这是您可以使用的库列表。
After the.csv file is created you can use aws sdk ( aws-java-sdk-s3
) to upload the file.创建 .csv 文件后,您可以使用 aws sdk (
aws-java-sdk-s3
) 上传文件。 Reference link for S3 file upload S3文件上传参考链接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.