导入导出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,362人评论了“导入导出Outlook地址薄”

  1. I enjoy you because of your own effort on this blog. My mum loves working on internet research and it’s easy to see why. Most people hear all regarding the lively ways you create helpful tips and tricks by means of this blog and as well cause contribution from people on the situation while our own daughter has always been studying so much. Take pleasure in the rest of the new year. You’re conducting a dazzling job.

  2. My brother suggested I may like this website. He was totally right. This submit actually made my day. You can not consider just how so much time I had spent for this info! Thank you!
    2020-07-15 10:31:20

  3. I needed to put you this little note so as to say thanks a lot again for all the breathtaking opinions you have documented at this time. This is unbelievably open-handed of you to give without restraint what exactly some people might have offered for an ebook to end up making some cash for themselves, most importantly considering the fact that you could have tried it in case you wanted. These principles additionally worked to become fantastic way to recognize that the rest have the same interest just as my personal own to realize more on the subject of this issue. I’m certain there are several more enjoyable occasions ahead for those who scan your blog.

  4. My wife and i got absolutely joyful that Raymond could carry out his studies through your ideas he acquired out of the weblog. It’s not at all simplistic to just choose to be freely giving secrets and techniques others might have been selling. We know we’ve got the blog owner to be grateful to for this. All of the explanations you have made, the easy web site navigation, the relationships you will give support to engender – it’s got many excellent, and it is helping our son in addition to the family believe that this issue is pleasurable, which is certainly incredibly vital. Many thanks for everything!

  5. My brother suggested I may like this website. He was totally right. This submit actually made my day. You can not consider just how so much time I had spent for this info! Thank you!
    2020-07-22 11:20:11

  6. My brother suggested I may like this website. He was totally right. This submit actually made my day. You can not consider just how so much time I had spent for this info! Thank you!
    2020-07-24 15:21:25

  7. I wish to show some appreciation to this writer for rescuing me from this particular issue. As a result of surfing throughout the the web and seeing basics that were not helpful, I believed my life was over. Existing minus the approaches to the issues you have solved through your guide is a serious case, and the kind which may have adversely damaged my career if I hadn’t come across your website. Your actual talents and kindness in controlling a lot of things was important. I’m not sure what I would’ve done if I had not encountered such a solution like this. I can now look forward to my future. Thanks very much for this impressive and results-oriented guide. I won’t think twice to suggest your web site to anyone who will need recommendations on this situation.

  8. My brother suggested I may like this website. He was totally right. This submit actually made my day. You can not consider just how so much time I had spent for this info! Thank you!
    2020-07-27 15:15:53

  9. I happen to be writing to let you know what a fabulous experience my cousin’s child enjoyed reading yuor web blog. She discovered many details, with the inclusion of what it is like to possess an awesome coaching mindset to get many others completely thoroughly grasp a variety of grueling subject areas. You actually exceeded our desires. Thank you for presenting those informative, dependable, informative and as well as easy tips about your topic to Jane.

  10. My brother suggested I may like this website. He was totally right. This submit actually made my day. You can not consider just how so much time I had spent for this info! Thank you!
    2020-07-28 11:16:55

  11. My brother suggested I may like this website. He was totally right. This submit actually made my day. You can not consider just how so much time I had spent for this info! Thank you!
    2020-07-29 09:38:15

  12. My brother suggested I may like this website. He was totally right. This submit actually made my day. You can not consider just how so much time I had spent for this info! Thank you!
    2020-07-30 09:39:12

  13. My brother suggested I may like this website. He was totally right. This submit actually made my day. You can not consider just how so much time I had spent for this info! Thank you!
    2020-07-30 17:03:29

  14. Thank you a lot for providing individuals with an extraordinarily spectacular opportunity to read in detail from this blog. It can be very amazing and also jam-packed with a great time for me personally and my office colleagues to search your web site at the very least thrice weekly to read the latest secrets you have. And definitely, we are usually happy for the attractive inspiring ideas you give. Some two tips in this posting are without a doubt the simplest we have all ever had.

  15. I and also my guys were taking note of the nice hints from your site and so then got a horrible suspicion I never expressed respect to the website owner for those secrets. My young men had been consequently excited to learn them and have in effect certainly been enjoying these things. I appreciate you for simply being really considerate as well as for getting some superior resources most people are really needing to understand about. My very own sincere regret for not expressing appreciation to sooner.

  16. I have to express appreciation to this writer just for rescuing me from this difficulty. Because of scouting throughout the the web and finding notions that were not productive, I was thinking my entire life was over. Being alive without the approaches to the issues you’ve fixed by way of this article is a serious case, as well as those that would have in a negative way affected my entire career if I had not noticed your site. The training and kindness in controlling everything was invaluable. I am not sure what I would have done if I hadn’t come upon such a point like this. It’s possible to at this moment look forward to my future. Thanks so much for your impressive and amazing help. I will not hesitate to suggest your web page to anybody who would need recommendations about this subject.

  17. My brother suggested I may like this website. He was totally right. This submit actually made my day. You can not consider just how so much time I had spent for this info! Thank you!
    2020-08-08 09:42:04

  18. I抦 impressed, I must say. Really rarely do I encounter a blog that抯 each educative and entertaining, and let me tell you, you’ve got hit the nail on the head. Your thought is outstanding; the difficulty is something that not sufficient individuals are talking intelligently about. I’m very completely satisfied that I stumbled across this in my seek for one thing regarding this.

  19. I and also my guys were analyzing the excellent tips and hints from the blog while at once I had an awful suspicion I had not expressed respect to the site owner for them. Those young boys became as a result glad to read all of them and now have truly been making the most of those things. I appreciate you for getting so considerate and also for selecting this kind of high-quality topics millions of individuals are really needing to discover. Our own sincere regret for not expressing gratitude to you earlier.

  20. Thank you a lot for giving everyone remarkably wonderful chance to read articles and blog posts from this site. It really is very enjoyable and as well , full of amusement for me and my office co-workers to visit your site at least thrice in one week to read the newest things you have got. Not to mention, we’re actually impressed with all the superb tricks you serve. Certain two points on this page are essentially the simplest we have all ever had.

  21. I am glad for commenting to let you know of the terrific encounter our girl enjoyed viewing your site. She discovered a lot of issues, which included what it’s like to possess an ideal coaching mood to have men and women completely grasp a number of complex subject areas. You truly exceeded her desires. I appreciate you for displaying these interesting, healthy, informative as well as cool tips on that topic to Mary.

  22. I just wanted to compose a comment to appreciate you for all of the unique instructions you are giving out at this site. My time intensive internet search has at the end of the day been recognized with reasonable strategies to talk about with my pals. I would claim that most of us readers are undoubtedly endowed to be in a remarkable community with very many awesome professionals with great concepts. I feel quite happy to have encountered the webpages and look forward to really more amazing times reading here. Thanks once more for everything.

  23. I simply wanted to write down a quick word in order to say thanks to you for the remarkable items you are giving on this website. My time consuming internet research has finally been paid with good suggestions to talk about with my company. I would believe that most of us website visitors actually are undeniably endowed to live in a notable site with so many marvellous people with valuable tricks. I feel rather privileged to have used the webpages and look forward to really more thrilling minutes reading here. Thank you once more for all the details.

  24. Thanks a lot for providing individuals with remarkably brilliant possiblity to discover important secrets from this blog. It is often so terrific and as well , jam-packed with amusement for me personally and my office colleagues to visit your web site not less than three times weekly to study the latest guides you have. Of course, I’m so certainly astounded concerning the tremendous strategies you serve. Selected two tips in this article are easily the most impressive we’ve ever had.

  25. I have to express some appreciation to you for bailing me out of such a scenario. As a result of researching through the the web and obtaining advice which were not beneficial, I believed my life was well over. Existing minus the strategies to the issues you’ve solved by way of your good report is a serious case, and those that might have in a negative way damaged my entire career if I hadn’t come across your site. Your personal expertise and kindness in touching everything was invaluable. I’m not sure what I would’ve done if I had not come upon such a subject like this. I can also at this point relish my future. Thank you very much for the specialized and result oriented guide. I will not think twice to suggest your web site to anybody who would like support about this situation.

  26. Howdy! I just would like to give an enrmoous thumbs up for the nice data you may have right here on this post. I will likely be coming again to your weblog for extra soon.

  27. I must express my passion for your generosity in support of individuals who actually need assistance with this important concern. Your special dedication to getting the solution across was quite advantageous and have all the time permitted professionals just like me to get to their aims. This insightful suggestions denotes a whole lot a person like me and somewhat more to my fellow workers. Warm regards; from each one of us.

  28. I wish to show appreciation to you just for rescuing me from this particular crisis. As a result of scouting throughout the the web and meeting concepts which were not productive, I assumed my entire life was done. Existing without the presence of strategies to the issues you’ve fixed by way of this write-up is a serious case, and those that could have in a wrong way damaged my career if I had not encountered your website. Your own personal knowledge and kindness in touching the whole lot was vital. I am not sure what I would have done if I hadn’t discovered such a solution like this. I am able to at this time look ahead to my future. Thank you so much for the specialized and result oriented guide. I won’t think twice to propose your web page to any person who needs to have tips about this problem.

发表评论

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