블로그 이미지
보미아빠

카테고리

보미아빠, 석이 (528)
밥벌이 (16)
싸이클 (1)
일상 (1)
Total
Today
Yesterday

달력

« » 2025.8
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

공지사항

최근에 올라온 글

unicode findstr

카테고리 없음 / 2024. 2. 14. 14:47
$tempResults =  'filelist1.txt' 
Set-Content -Path $tempResults -Value 'Path\Name.Extension, FileSize' -Encoding UTF8

foreach( $file in (Get-ChildItem -File -Path 'C:\path' -Recurse) )
{
    $nameCount = Get-Content -Path $file.FullName -Encoding UTF8 | Select-String -Pattern 'userFindString' | Measure-Object | Select-Object -ExpandProperty Count

    if( $nameCount -gt 0 )
    {
                $line =  $file.DirectoryName + '\' + $file.BaseName + $file.Extension + ' ' + $file.Length + ' ' + $file.CreationTime
        Add-Content -Path $tempResults -Value $line -Encoding UTF8
    }
}
clear 
type $tempResults
#notepad $tempResults
remove-item $tempResults

 

Posted by 보미아빠
, |
SELECT 
	ISNULL(TRIM(',' FROM STRING), ''), -- 왼쪽 오른쪽 다 날리기
	ISNULL(LTRIM(RTRIM(STRING,','),','), ''), -- 왼쪽 오른쪽 다 날리기 
	STUFF(STRING,1,1,''), -- 첫 문자 하나만 날리기
	ISNULL(SUBSTRING (STRING, 2, NULLIF(LEN(STRING)-1,-1)), ''), -- 첫 문자 하나만 날리기
	ISNULL(SUBSTRING (STRING, 1, NULLIF(LEN(STRING)-1,-1)), '')  -- 마지막 문자 하나만 날리기 
FROM 
	( 
	  VALUES 
	  (NULL)   
	, ('1,2')   
	, (',,1,2,,,')
	, (',1,2')   
	, ('1,2,')   
	) A (STRING)

 

Posted by 보미아빠
, |
for /f "skip=9 tokens=1,2 delims=:" %i in ('netsh wlan show profiles') do @echo %j | findstr -i -v echo | netsh wlan show profiles %j key=clear

 

cmd 에서 위 명령어를 치면 해당 컴퓨터로 연결되었던 모든 wifi 비밀번호가 출력된다. 

 

Posted by 보미아빠
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함