Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <h1>Taipei Metro EasyCard Transaction PDF Converter</h1>
<p>This converter is for you to extract instructive data from the <a href="https://queryweb.tscc.com.tw/mrt_web/default.aspx">Taipei Metro EasyCard Transaction</a> PDF file, and allow you to put these data into the sheets. (Divide columns with tabs.)</p>

<form action="">
  <textarea name="" id="t" cols="90" rows="20">
臺北大眾捷運股份有限公司 
列印日期:  2018/8/8 捷運悠遊卡搭乘證明 
乘 車 日 期: 2018/05/13 14:42:24 進 站 名 稱: 板橋 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 新莊 
悠 遊 卡 號:  7788449151 收 費 金 額:  48 
交 易 類 別: 扣款 
乘 車 日 期: 2018/06/09 13:25:49 進 站 名 稱: 竹圍 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 台北101/世貿 
悠 遊 卡 號:  7788449151 收 費 金 額:  34 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/01 09:17:28 進 站 名 稱: 西門 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 善導寺 
悠 遊 卡 號:  7788449151 收 費 金 額:  26 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/01 19:30:44 進 站 名 稱: 善導寺 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 西門 
悠 遊 卡 號:  7788449151 收 費 金 額:  32 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/04 09:03:49 進 站 名 稱: 板橋 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 台北101/世貿 
悠 遊 卡 號:  7788449151 收 費 金 額:  44 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/04 18:52:47 進 站 名 稱: 台北101/世貿 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 板橋 
悠 遊 卡 號:  7788449151 收 費 金 額:  44 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/07 08:52:37 進 站 名 稱: 板橋 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 萬芳醫院 
悠 遊 卡 號:  7788449151 收 費 金 額:  48 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/07 19:12:42 進 站 名 稱: 萬芳醫院 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 板橋 
悠 遊 卡 號:  7788449151 收 費 金 額:  48 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/08 08:57:27 進 站 名 稱: 板橋 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 萬芳醫院 
悠 遊 卡 號:  7788449151 收 費 金 額:  48 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/08 19:07:34 進 站 名 稱: 萬芳醫院 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 板橋 
悠 遊 卡 號:  7788449151 收 費 金 額:  48 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/14 09:21:02 進 站 名 稱: 西門 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 善導寺 
悠 遊 卡 號:  7788449151 收 費 金 額:  26 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/14 22:50:17 進 站 名 稱: 台電大樓 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 西門 
悠 遊 卡 號:  7788449151 收 費 金 額:  36 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/15 09:17:16 進 站 名 稱: 西門 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 善導寺 
悠 遊 卡 號:  7788449151 收 費 金 額:  26 
交 易 類 別: 扣款  

Page 1 

臺北大眾捷運股份有限公司 
列印日期:  2018/8/8 捷運悠遊卡搭乘證明 
乘 車 日 期: 2018/07/15 19:23:55 進 站 名 稱: 善導寺 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 西門 
悠 遊 卡 號:  7788449151 收 費 金 額:  27 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/21 09:24:12 進 站 名 稱: 西門 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 善導寺 
悠 遊 卡 號:  7788449151 收 費 金 額:  26 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/21 18:34:29 進 站 名 稱: 善導寺 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 西門 
悠 遊 卡 號:  7788449151 收 費 金 額:  32 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/22 18:24:04 進 站 名 稱: 善導寺 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 新店區公所 
悠 遊 卡 號:  7788449151 收 費 金 額:  24 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/22 23:39:35 進 站 名 稱: 新店區公所 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 西門 
悠 遊 卡 號:  7788449151 收 費 金 額:  44 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/28 09:04:13 進 站 名 稱: 民權西路 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 善導寺 
悠 遊 卡 號:  7788449151 收 費 金 額:  16 
交 易 類 別: 扣款 
乘 車 日 期: 2018/07/28 18:36:51 進 站 名 稱: 善導寺 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 西門 
悠 遊 卡 號:  7788449151 收 費 金 額:  32 
交 易 類 別: 扣款 
乘 車 日 期: 2018/08/05 10:24:31 進 站 名 稱: 劍潭 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 台北101/世貿 
悠 遊 卡 號:  7788449151 收 費 金 額:  24 
交 易 類 別: 扣款 
乘 車 日 期: 2018/08/05 22:09:22 進 站 名 稱: 台北101/世貿 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 民權西路 
悠 遊 卡 號:  7788449151 收 費 金 額:  20 
交 易 類 別: 扣款 
乘 車 日 期: 2018/08/07 21:29:15 進 站 名 稱: 象山 
卡片外觀號碼: 9122111200650456  出 站 名 稱: 西門 
悠 遊 卡 號:  7788449151 收 費 金 額:  40 
交 易 類 別: 扣款  

Page 2 
</textarea>
  <p>
    <button type="button">Convert</button>
  </p>
  <p id="status"></p>
</form>
              
            
!

CSS

              
                textarea{
  width: 100%;
}
              
            
!

JS

              
                
/* 2018-Spring
function yyyy(yyy){
  yyy = yyy.replace(/臺北大眾捷運股份有限公司.+/gm, "");
  yyy = yyy.replace(/列印日期.+/gm, "");
  yyy = yyy.replace(/Page.+/gm, "");
  yyy = yyy.replace(/^\s*\n/gm, "");
  yyy = yyy.replace(/乘 車 日 期: /gm, "");
  yyy = yyy.replace(/ 進 站 名 稱: /gm, "\t");
  yyy = yyy.replace(/\s*\n卡片外觀號碼: /gm, "\t");
  yyy = yyy.replace(/  出 站 名 稱: /gm, "\t");
  yyy = yyy.replace(/\s*\n悠 遊 卡 號:  /gm, "\t");
  yyy = yyy.replace(/ 收 費 金 額:  /gm, "\t");
  yyy = yyy.replace(/\s*\n交 易 類 別: /gm, "\t");
  // yyy = yyy.replace(/乘 車 日 期: /gm, "");
  // function replacer(match, p1, p2, p3, offset, string) {
  //   var sub = parseInt(p1);
  //   sub += 1911;
  //   return sub + p2 + " ";
  // }
  // return yyy.replace(/(^\d{3})(\/\d{2}\/\d{2})(\n)/gm, replacer);
  return yyy;
}
*/

function yyyy(yyy){
  yyy = yyy.replace(/臺北大眾捷運股份有限公司.+/gm, "");
  yyy = yyy.replace(/列印日期.+/gm, "");
  yyy = yyy.replace(/Page.+/gm, "");
  yyy = yyy.replace(/^\s*\n/gm, "");
  yyy = yyy.replace(/乘車日期:/gm, "");
  yyy = yyy.replace(/進站名稱:/gm, "\t");
  yyy = yyy.replace(/卡片外觀號碼:/gm, "\t");
  yyy = yyy.replace(/出站名稱:/gm, "\t");
  yyy = yyy.replace(/悠遊卡號:/gm, "\t");
  yyy = yyy.replace(/收費金額:/gm, "\t");
  yyy = yyy.replace(/交易類別:/gm, "\t");
  // yyy = yyy.replace(/乘 車 日 期: /gm, "");
  // function replacer(match, p1, p2, p3, offset, string) {
  //   var sub = parseInt(p1);
  //   sub += 1911;
  //   return sub + p2 + " ";
  // }
  // return yyy.replace(/(^\d{3})(\/\d{2}\/\d{2})(\n)/gm, replacer);
  return yyy;
}

document.querySelector("button").addEventListener("click", function(){
  var v = document.querySelector("textarea").value;
  document.querySelector("textarea").value = yyyy(v);
  document.querySelector("textarea").select();
  document.execCommand("copy");
  document.getElementById("status").textContent = "Copied!";
});

document.querySelector("textarea").addEventListener("click", function(){
  this.select();
});
              
            
!
999px

Console