导入导出Outlook地址薄

1.导出
从Outlook选择文本模式导出的地址薄是以”,”分割的,而且大部分导出的地址薄也都是以”,”分割的,这样就可以用String类的split方法,主要的源代码:
[java]
BufferedReader bufReader = new BufferedReader(new InputStreamReader(importFile.getInputStream()));
//BufferedReader bufReader = new BufferedReader(new FileReader(filepath));
String header = bufReader.readLine();
String[] attributes = header.split(split);
String line;
while((line = bufReader.readLine()) != null) {
String[] addressAttributes = line.split(split);
int size = addressAttributes.length;
WdxcAddressbook addbook = new WdxcAddressbook();
for(int i = 0;i < attributes.length;i++) {
if(attributes[i].equalsIgnoreCase(“Name”) || attributes[i].equalsIgnoreCase(“姓名”)) {
if(i < size) {
addbook.setRealname(addressAttributes[i]);
continue;
}
else {
break;
}
}
}
}
bufReader.close();
[/java]

2.导出
导出成Excel格式:
[java]
ExternalContext context =
FacesContext.getCurrentInstance().getExternalContext();
HttpServletResponse response = (HttpServletResponse)context.getResponse();
response.addHeader(“Content-Disposition”,”attachment;filename=wdxcaddressbook.xls”);
response.setCharacterEncoding(“GB2312”);
response.setContentType(“application/ms-excel”);
try {
//PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(“E:addressbook.xls”)));
PrintWriter pw = response.getWriter();
pw.println(“Name” + “t” + “E-mail Address” + “t” + “Mobile Phone” + “t” + “Home Phone” + “t” + “Company” + “t” + “Home Street” + “t” + “Home Postal Code” + “t” + “Personal Web Page” + “t” + “Notes”);
List list = addressbookService.getAddressbookByOwnerAndEmail(this.getPrinciple().getUserid(),null);
for(int i = 0;i < list.size();i++) {
WdxcAddressbook address = (WdxcAddressbook)list.get(i);
pw.print(address.getRealname());
pw.print(“t”);
pw.print(address.getEmail());
pw.print(“t”);
}
}catch()
pw.close();
[/java]

3.存在的问题
但导出的Outlook地址薄是以”,”分割的,如果自己有在地址中有”,”,Outlook会自动在这个字段两端添加”””,所有光用split会有点问题的

1,691人评论了“导入导出Outlook地址薄”

  1. I simply had to thank you so much once again. I’m not certain the things I could possibly have tried without the entire points revealed by you directly on that subject. This was a troublesome crisis in my view, but discovering your specialised technique you managed it forced me to leap for gladness. I will be happier for this help and in addition have high hopes you really know what a powerful job you’re doing training people today using a web site. I know that you haven’t come across all of us.

  2. I like the helpful info you provide to your articles. I’ll bookmark your blog and check once more here regularly. I’m fairly sure I’ll be informed many new stuff right here! Best of luck for the next!|

  3. I needed to write you the bit of note to give many thanks again with the lovely pointers you’ve provided on this website. It was certainly incredibly generous with you to make unreservedly precisely what a few people might have distributed for an e book to end up making some profit on their own, mostly considering the fact that you could have done it in case you wanted. These guidelines also worked to become a good way to recognize that most people have similar zeal similar to my own to grasp much more on the topic of this matter. I am sure there are many more pleasant periods up front for many who read through your site.

  4. I wish to convey my passion for your kindness for individuals who actually need help with your field. Your personal commitment to passing the solution all-around had become rather useful and have surely encouraged others like me to get to their ambitions. Your invaluable help signifies so much to me and even further to my office workers. Best wishes; from all of us.

  5. Thanks for any other wonderful article. The place else may just anybody get that kind of info in such an ideal manner of writing? I have a presentation next week, and I am on the search for such information.|

  6. I simply wished to thank you so much once again. I do not know what I would have gone through in the absence of the entire solutions shared by you on my industry. It was a frightening problem in my view, nevertheless observing your well-written style you dealt with the issue forced me to jump with contentment. I am just thankful for this service and as well , expect you realize what a powerful job that you’re carrying out training the mediocre ones using a web site. I am sure you have never met all of us.

  7. I have to show some appreciation to the writer just for bailing me out of this particular situation. After surfing through the online world and getting opinions that were not beneficial, I thought my life was done. Living without the solutions to the problems you have solved by way of your good report is a crucial case, and the ones which might have badly damaged my career if I had not encountered your web blog. That talents and kindness in taking care of almost everything was vital. I don’t know what I would’ve done if I had not encountered such a step like this. I am able to now look ahead to my future. Thanks for your time so much for this impressive and result oriented guide. I won’t think twice to endorse your web blog to anyone who desires tips about this subject.

  8. I wish to convey my gratitude for your generosity for those who require assistance with this particular concern. Your real dedication to getting the solution all around ended up being extremely practical and have always made guys just like me to reach their targets. Your amazing invaluable recommendations indicates a lot to me and far more to my mates. Many thanks; from each one of us.

  9. Thank you so much for giving everyone an exceptionally memorable chance to read in detail from this web site. It really is very lovely plus stuffed with a good time for me and my office friends to search the blog on the least 3 times in 7 days to read the newest guides you have got. And of course, I’m just at all times pleased concerning the terrific concepts you serve. Some 4 tips in this post are basically the most efficient I have ever had.

  10. I’m extremely impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you modify it yourself? Either way keep up the nice quality writing, it’s rare to see a nice blog like this one nowadays.|

  11. I intended to post you a tiny word so as to give thanks over again for the breathtaking pointers you have contributed above. It was certainly wonderfully open-handed of people like you in giving openly just what most people could possibly have sold for an ebook in order to make some bucks for their own end, even more so since you might have done it if you considered necessary. These thoughts likewise served to be the good way to fully grasp some people have a similar dreams just as my own to find out very much more with reference to this issue. I am certain there are millions of more fun sessions in the future for folks who scan your blog post.

  12. I needed to compose you this bit of note to help thank you as before about the fantastic suggestions you’ve documented on this page. It is certainly unbelievably open-handed of you to offer extensively what a number of people would’ve marketed for an e book in making some dough for their own end, specifically since you could possibly have done it if you ever decided. Those concepts also served to be the great way to understand that the rest have the identical passion just like my own to understand many more in terms of this issue. I think there are thousands of more enjoyable moments up front for those who scan through your blog.

  13. I definitely wanted to develop a brief comment to be able to say thanks to you for the remarkable guidelines you are showing on this site. My time consuming internet investigation has at the end of the day been paid with incredibly good information to write about with my visitors. I would tell you that we readers are very lucky to exist in a notable website with so many perfect professionals with good hints. I feel rather grateful to have discovered your entire weblog and look forward to so many more pleasurable times reading here. Thanks once again for everything.

  14. I want to convey my appreciation for your generosity supporting all those that must have assistance with this particular matter. Your special dedication to passing the solution along had become incredibly powerful and have specifically helped those much like me to get to their targets. Your own interesting recommendations means this much a person like me and even more to my colleagues. Regards; from each one of us.

  15. I wish to express my respect for your generosity in support of individuals that absolutely need help with this concept. Your real dedication to passing the solution along became exceedingly productive and has always helped folks just like me to arrive at their ambitions. Your helpful guidelines entails a whole lot to me and somewhat more to my office workers. Thanks a lot; from each one of us.

  16. I must show my admiration for your kindness for persons that require help with this one study. Your special commitment to getting the solution throughout became really helpful and has continually empowered those like me to attain their goals. Your entire valuable suggestions entails a great deal to me and somewhat more to my peers. Thanks a lot; from all of us.

  17. I’m extremely impressed along with your writing skills and also with the layout for your blog. Is this a paid theme or did you customize it your self? Anyway stay up the nice high quality writing, it’s uncommon to see a great blog like this one today..|

  18. I simply had to thank you so much all over again. I’m not certain the things I could possibly have gone through in the absence of these suggestions revealed by you relating to this subject matter. It has been a very difficult matter in my position, nevertheless discovering the very well-written strategy you dealt with it took me to cry over happiness. I am happier for this guidance and as well , pray you realize what a powerful job you’re undertaking teaching the rest thru a web site. Probably you’ve never got to know any of us.

  19. Needed to draft you that little bit of note to thank you the moment again with your marvelous opinions you’ve shared above. It is simply surprisingly generous of people like you to offer publicly all that many individuals could possibly have offered as an e book to end up making some cash for their own end, even more so since you could possibly have tried it if you ever considered necessary. Those suggestions additionally served to be a fantastic way to recognize that the rest have the same desire really like my own to learn a great deal more with regards to this problem. I believe there are thousands of more enjoyable instances in the future for individuals who start reading your blog.

  20. My spouse and I stumbled over here by a different website and thought I might as well check things out. I like what I see so now i’m following you. Look forward to looking into your web page again.|

  21. I think everything published made a ton of sense. But, what about this? what if you added a little content? I mean, I don’t want to tell you how to run your blog, but what if you added a post title to possibly get people’s attention? I mean %BLOG_TITLE% is a little vanilla. You should glance at Yahoo’s home page and watch how they create news titles to grab people to click. You might try adding a video or a related pic or two to grab people interested about everything’ve got to say. In my opinion, it might make your posts a little bit more interesting.|

  22. I do agree with all the ideas you have presented for your post. They are very convincing and can definitely work. Nonetheless, the posts are very quick for novices. May you please lengthen them a bit from next time? Thanks for the post.|

  23. I wish to show thanks to you for rescuing me from this type of issue. Just after scouting throughout the online world and obtaining things that were not productive, I believed my life was well over. Existing minus the strategies to the issues you’ve fixed through your main short post is a crucial case, and the ones which may have badly affected my entire career if I hadn’t noticed your web blog. Your own know-how and kindness in touching all things was excellent. I don’t know what I would have done if I hadn’t come across such a stuff like this. I’m able to at this point look forward to my future. Thanks a lot very much for your high quality and effective guide. I will not hesitate to propose your blog to any person who should receive guidance about this topic.

  24. I truly wanted to develop a small comment so as to express gratitude to you for those wonderful tips and tricks you are giving at this site. My incredibly long internet look up has at the end of the day been rewarded with reputable ideas to exchange with my partners. I ‘d say that most of us site visitors actually are unquestionably endowed to dwell in a notable site with many lovely people with valuable tips and hints. I feel truly happy to have come across your website and look forward to some more awesome minutes reading here. Thank you once more for all the details.

  25. I have to express appreciation to you just for bailing me out of this type of trouble. Just after browsing throughout the internet and obtaining recommendations which are not pleasant, I was thinking my life was done. Existing without the strategies to the issues you have solved all through your good website is a critical case, as well as the kind which may have negatively damaged my career if I had not encountered your blog post. Your primary expertise and kindness in playing with the whole thing was important. I’m not sure what I would have done if I had not encountered such a point like this. I am able to at this time relish my future. Thank you very much for the expert and effective help. I won’t think twice to propose the blog to any individual who will need assistance on this topic.

  26. I have to show my admiration for your kind-heartedness in support of women who require assistance with in this concern. Your special commitment to getting the message across had been unbelievably effective and have enabled those much like me to achieve their endeavors. Your valuable tips and hints indicates a whole lot a person like me and somewhat more to my office workers. Thank you; from everyone of us.

  27. I’m amazed, I must say. Rarely do I encounter a blog that’s equally educative and interesting, and let me tell you, you’ve hit the nail on the head. The problem is something that not enough folks are speaking intelligently about. I’m very happy I came across this during my search for something concerning this.|

  28. I actually wanted to develop a brief comment so as to thank you for these magnificent ways you are sharing at this site. My long internet look up has at the end been compensated with excellent content to exchange with my great friends. I ‘d express that many of us readers actually are really lucky to be in a good community with so many marvellous people with very helpful basics. I feel extremely lucky to have discovered your web page and look forward to really more brilliant times reading here. Thanks once more for everything.

  29. Thank you for your own work on this web site. Betty delights in conducting investigations and it’s obvious why. My partner and i hear all of the dynamic form you deliver advantageous information on the website and even improve contribution from the others on that idea then my princess is undoubtedly discovering a whole lot. Take advantage of the remaining portion of the year. You’re performing a stunning job.

发表评论

电子邮件地址不会被公开。 必填项已用*标注