久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何使用“標(biāo)簽空間"在寫入文本文件時(shí)

how to use quot;tab spacequot; while writing in text file(如何使用“標(biāo)簽空間在寫入文本文件時(shí))
本文介紹了如何使用“標(biāo)簽空間"在寫入文本文件時(shí)的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

 SimpleDateFormat formatter = new SimpleDateFormat("ddMMyyyy_HHmmSS");
 String strCurrDate = formatter.format(new java.util.Date());
 String strfileNm = "Cust_Advice_" + strCurrDate + ".txt";
 String strFileGenLoc = strFileLocation + "/" + strfileNm;
 String strQuery="select name, age, data from basetable";
 try {

     stmt = conn.createStatement();
     System.out.println("Query is -> " + strQuery);
     rs = stmt.executeQuery(strQuery);

     File f = new File(strFileGenLoc);
     OutputStream os = (OutputStream)new FileOutputStream(f);
     String encoding = "UTF8";
     OutputStreamWriter osw = new OutputStreamWriter(os, encoding);
     BufferedWriter bw = new BufferedWriter(osw);

     while (rs.next() ) {

         bw.write(rs.getString(1)==null? "":rs.getString(1));
         bw.write("  ");
         bw.write(rs.getString(2)==null? "":rs.getString(2));
         bw.write("  ");

     }
     bw.flush();
     bw.close();
 } catch (Exception e) {
     System.out.println(
         "Exception occured while getting resultset by the query");
     e.printStackTrace();
 } finally {
     try {
         if (conn != null) {
             System.out.println("Closing the connection" + conn);
             conn.close();
         }
     } catch (SQLException e) {
         System.out.println(
             "Exception occured while closing the connection");
         e.printStackTrace();
      }
    }
         return objArrayListValue;
  }

我在每列之間需要一個(gè)制表符空間"(寫入文本文件時(shí)).喜歡

i need "one tab space" in between each column(while writing to text file). like

   manu 25 data1
   manc 35 data3

在我的代碼中,我使用 bw.write(" ") 在每列之間創(chuàng)建空間.如何在那個(gè)地方使用一個(gè)標(biāo)簽空間"而不是給空間".

in my code i use bw.write(" ") for creating space between each column. how to use "one tab space" in that place instead of giving "space".

推薦答案

您可以使用 在文件中創(chuàng)建選項(xiàng)卡.

You can use to create a tab in a file.

這篇關(guān)于如何使用“標(biāo)簽空間"在寫入文本文件時(shí)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環(huán)繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動(dòng)生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數(shù)據(jù)庫(kù))
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對(duì)象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 天堂色 | 一区二区三区视频在线 | 爱草视频| 久久草视频| 久久99精品国产 | 国产精品伦理一区二区三区 | 黄色片视频免费 | 男女网站免费 | 99久久99| 亚洲h视频 | 中文字幕在线免费观看 | 日本欧美国产在线 | 亚洲精品2 | 毛片免费在线 | 亚洲一区二区三区在线视频 | 伊人久久综合影院 | 亚洲成人av在线播放 | 狠狠伊人 | 国产精品久久久久久久久免费相片 | 欧美一区二区三区一在线观看 | 日韩高清国产一区在线 | 成人精品一区二区 | 伊人热久久 | 精品乱人伦一区二区三区 | 日韩中文字幕在线视频 | 国产精品大全 | 一区二区精品电影 | 日本五月婷婷 | 欧美三级视频在线观看 | 久久久999免费视频 999久久久久久久久6666 | 久久九精品| 久久视频免费看 | 日韩一二三区视频 | caoporn免费| 综合久久99 | 国产在线一区观看 | 精品欧美一区二区三区久久久 | 黄色一级免费 | 亚洲精品大全 | 九九综合 | 99欧美精品|