PageSourceSearch

https://dc-tools.cc/assets/TextCsvRemoveEmptyRowsTool-B2lDKIUR.js

js dc-tools.cc collected 2026-10-02 01:20:29 UTC 3,288 bytes, 1 lines download raw bytes

1import{r as n,j as e}from"./index-Cp6oVmJn.js";import{T as f}from"./ToolSeoSection-RrG1c4TM.js";import{g as E,r as P}from"./generatedTextTransforms-DWxAXewb.js";/* empty css                     */const p="text_csv_remove_empty_rows",B={name:"text"},j=[],v={},N={zh:{title:"CSV 移除空白列",subtitle:"移除 CSV 或貼上表格中的空白列,適合清理匯入資料與試算表複製內容。",inputPlaceholder:"在此輸入或貼上內容...",processBtn:"開始處理",processing:"處理中...",copyBtn:"複製結果",downloadBtn:"下載結果",reset:"重置",empty:"請先輸入要處理的內容。",copied:"已複製"},en:{title:"CSV Empty Row Remover",subtitle:"Remove empty rows from CSV or pasted table data before import or review.",inputPlaceholder:"Enter or paste content here...",processBtn:"Process",processing:"Processing...",copyBtn:"Copy Result",downloadBtn:"Download Result",reset:"Reset",empty:"Enter content before processing.",copied:"Copied"}},_=i=>String(i).toLowerCase().startsWith("en")?N.en:N.zh;function k({language:i="zh"}){const[c,d]=n.useState(""),[u,m]=n.useState(v),[o,x]=n.useState(""),[g,l]=n.useState(""),[h,b]=n.useState(!1),s=_(i),y=n.useMemo(()=>c.trim().length>0,[c]),T=(t,a)=>{m(r=>({...r,[t]:a}))},w=()=>{if(!y){l(s.empty);return}b(!0);try{const t=P(p,{text:c,...u});x(t),l("")}catch(t){l(t.message||"Failed to process input.")}finally{b(!1)}},C=async()=>{o&&(await navigator.clipboard.writeText(o),l(s.copied))},R=()=>{if(!o)return;const t=new Blob([o],{type:"text/plain;charset=utf-8"}),a=URL.createObjectURL(t),r=document.createElement("a");r.href=a,r.download=`${p}-result.txt`,r.click(),URL.revokeObjectURL(a)},S=()=>{d(""),m(v),x(""),l("")};return e.jsxs("div",{className:"tool-page",children:[e.jsxs("div",{className:"tool-page-content",children:[e.jsx("h1",{className:"tool-page-title",children:s.title}),e.jsx("p",{className:"tool-page-subtitle",children:s.subtitle}),e.jsxs("div",{className:"tool-page-body",children:[j.length>0&&e.jsx("div",{className:"tool-page-actions","aria-label":"Tool options",children:j.map(t=>e.jsxs("label",{style:{display:"grid",gap:"6px",minWidth:"180px"},children:[e.jsx("span",{className:"tool-page-stat-label",children:t.name}),e.jsx("input",{className:"tool-page-textarea",style:{minHeight:"auto",resize:"none"},type:"text",value:u[t.name]??"",onChange:a=>T(t.name,a.target.value)})]},t.name))}),e.jsx("textarea",{className:"tool-page-textarea",value:c,onChange:t=>d(t.target.value),placeholder:s.inputPlaceholder,"aria-label":B.name,rows:10}),e.jsxs("div",{className:"tool-page-actions",children:[e.jsx("button",{className:"tool-page-btn primary",onClick:w,disabled:!y||h,children:h?s.processing:s.processBtn}),o&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"tool-page-btn secondary",onClick:C,children:s.copyBtn}),e.jsx("button",{className:"tool-page-btn secondary",onClick:R,children:s.downloadBtn}),e.jsx("button",{className:"tool-page-btn secondary",onClick:S,children:s.reset})]})]}),g&&e.jsx("p",{className:"tool-page-subtitle","aria-live":"polite",children:g}),o&&e.jsx("div",{className:"tool-page-result",children:e.jsx("textarea",{className:"tool-page-textarea output",value:o,readOnly:!0,rows:10,"aria-label":"result"})})]})]}),e.jsx(f,{seoData:E[p]})]})}export{k as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.