• Abaqus (0)
  • Questions (1)
Ask a Question

Recent Posts

  • Thay thế New Line từ Clipboard với batch file (Window)
  • Macro Hypermesh tạo comp đối xứng, Tạo comps mới full thuộc tính như comps ban đầu
  • JSON vs VBA

Recent Comments

  • admin on Protected: chatchit
  • admin on Protected: chatchit
  • tt on Protected: chatchit
  • tt on Protected: chatchit
  • admin on Protected: chatchit
Tí Tẹo
  • Home
  • Community
  • Documents
  • CAE
    • Vật Liệu
    • Toán
  • Skill
  • Giải Trí
No Result
View All Result
  • Login
  • Register

Notifications

  • JSON vs VBA
    5 months
  • JSON vs VBA
    5 months
  • Thay thế New Line từ Clipboard với batch file (Window)
    5 months
  • Thay thế New Line từ Clipboard với batch file (Window)
    5 months
  • JSON vs VBA
    9 months
  • Macro Hypermesh tạo comp đối xứng, Tạo comps mới full thuộc tính như comps ban đầu
    9 months
  • Thay thế New Line từ Clipboard với batch file (Window)
    10 months
  • Thay thế New Line từ Clipboard với batch file (Window)
    10 months
  • JSON vs VBA
    12 months
  • JSON vs VBA
    12 months
  • Thay thế New Line từ Clipboard với batch file (Window)
    1 year
  • Thay thế New Line từ Clipboard với batch file (Window)
    1 year
  • JSON vs VBA
    1 year
  • JSON vs VBA
    1 year
  • Thay thế New Line từ Clipboard với batch file (Window)
    1 year
  • Thay thế New Line từ Clipboard với batch file (Window)
    1 year
  • Thay thế New Line từ Clipboard với batch file (Window)
    1 year
  • Thay thế New Line từ Clipboard với batch file (Window)
    1 year
  • Macro Hypermesh tạo comp đối xứng, Tạo comps mới full thuộc tính như comps ban đầu
    1 year
  • Macro Hypermesh tạo comp đối xứng, Tạo comps mới full thuộc tính như comps ban đầu
    1 year
  • Show older
Tí Tẹo
  • Home
  • Community
  • Documents
  • CAE
    • Vật Liệu
    • Toán
  • Skill
  • Giải Trí
No Result
View All Result
  • Login
  • Register

Notifications

  • JSON vs VBA
    5 months
  • JSON vs VBA
    5 months
  • Thay thế New Line từ Clipboard với batch file (Window)
    5 months
  • Thay thế New Line từ Clipboard với batch file (Window)
    5 months
  • JSON vs VBA
    9 months
  • Macro Hypermesh tạo comp đối xứng, Tạo comps mới full thuộc tính như comps ban đầu
    9 months
  • Thay thế New Line từ Clipboard với batch file (Window)
    10 months
  • Thay thế New Line từ Clipboard với batch file (Window)
    10 months
  • JSON vs VBA
    12 months
  • JSON vs VBA
    12 months
  • Thay thế New Line từ Clipboard với batch file (Window)
    1 year
  • Thay thế New Line từ Clipboard với batch file (Window)
    1 year
  • JSON vs VBA
    1 year
  • JSON vs VBA
    1 year
  • Thay thế New Line từ Clipboard với batch file (Window)
    1 year
  • Thay thế New Line từ Clipboard với batch file (Window)
    1 year
  • Thay thế New Line từ Clipboard với batch file (Window)
    1 year
  • Thay thế New Line từ Clipboard với batch file (Window)
    1 year
  • Macro Hypermesh tạo comp đối xứng, Tạo comps mới full thuộc tính như comps ban đầu
    1 year
  • Macro Hypermesh tạo comp đối xứng, Tạo comps mới full thuộc tính như comps ban đầu
    1 year
  • Show older
Tí Tẹo
No Result
View All Result

Thay thế New Line từ Clipboard với batch file (Window)

Replace newlines from clipboard With batch file

0

Công cụ nhỏ này về cơ bản là giúp sao chép văn bản và loại bỏ “dòng mới, ngắt dòng” sau mỗi dòng. Tool này đặc biệt giúp ích khi sao chép và dán văn bản từ một file PDF

Video demo

Code 1

@echo off
@break off
@title TrinhTB-Clipboard
@CLS
chcp 65001
setlocal EnableDelayedExpansion

set "mypath=%~dp0"
cd /d %mypath%
>clipboard.temp=(powershell -command "Get-Clipboard")
for /f "delims=" %%a in (clipboard.temp) do (
	set "line=!line! %%a"
)
rem !line!>clipboardfile.tmp
rem clip<clipboardfile.tmp
echo "!line!"|clip
del clipboard.temp
endlocal
exit

Code 2

<# : bat File
@echo off
@break off
@title TrinhTB-Clipboard
@CLS
chcp 65001
setlocal EnableDelayedExpansion

set "mypath=%~dp0"
cd /d %mypath%
for /f "delims=" %%a in ('powershell -noprofile "iex (${%~f0} | out-string)"') do (
	set "line=!line! %%a"
)
echo "!line!" | clip
endlocal
exit
: end Batch #>
Get-Clipboard

Code 3

<# : bat File
@echo off
@break off
@title TrinhTB-Clipboard
chcp 65001
@CLS

set "mypath=%~dp0" 
cd /d %mypath% 
set ^"LF=^
"
powershell -noprofile -command "$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding; $mysw='clipboard'; $myargs=$null; Invoke-Expression (${%~f0} | out-string)" 

:End 
endlocal 
exit 
: end Batch #>

<# : comment
Add-Type -AssemblyName PresentationCore,PresentationFramework 
$ButtonType = [System.Windows.MessageBoxButton]::YesNoCancel 
$MessageIcon = [System.Windows.MessageBoxImage]::Error 
$MessageBody = $myargs 
$MessageTitle = "Confirm " 
$Result = [System.Windows.MessageBox]::Show($MessageBody,$MessageTitle,$ButtonType,$MessageIcon) 

if($Result -eq "Yes") { 
	Write-Host "$Result" 
} 
$myargs=$null; 
if (!($myargs)) { write "Zero, null or Empty"} 
: comment #>

Add-Type -AssemblyName System.Windows.Forms

switch ($mysw) {
	"clipboard" {
		$myClipboard = Get-Clipboard;
		$myClipboard=$myClipboard -join "";
		[System.Windows.Forms.Clipboard]::Clear();
		$myClipboard = $myClipboard.replace([Environment]::NewLine, " ").replace(".",".");
		Set-Clipboard -Value $myClipboard;
		break;
	}
}

Lưu code trên với file có phần mở rộng là “.bat” hoặc tải file dưới đây

ReplaceNewlinesDownload

Related Posts

No Content Available

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Home
  • Community
  • Documents
  • CAE
  • Skill
  • Giải Trí

© 2021 Tí Tẹo

No Result
View All Result
  • Home
  • Community
  • Documents
  • CAE
    • Vật Liệu
    • Toán
  • Skill
  • Giải Trí

© 2021 Tí Tẹo

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In