|
Êîìïüþòåðíûé ôîðóì OSzone.net » Ïðîãðàììèðîâàíèå, áàçû äàííûõ è àâòîìàòèçàöèÿ äåéñòâèé » Ñêðèïòîâûå ÿçûêè àäìèíèñòðèðîâàíèÿ Windows » PowerShell - [ðåøåíî] Ðåäàêòèðîâàíèå ôàéëà ñ ñèìâîëàìè |
|
|
PowerShell - [ðåøåíî] Ðåäàêòèðîâàíèå ôàéëà ñ ñèìâîëàìè
|
Íîâûé ó÷àñòíèê Ñîîáùåíèÿ: 22 |
Åñòü ðåäàêòèðóåìûé ôàéë, âíóòðè íåãî ïîäîáíîå:
»˜¢8bgatvvwfbcmk4joye403s2970Ií²åˆ ¸2ßú¶ötÌ“Ö!9ÿ1<?xml version='1.0' encoding='utf-8'?><products><product> Åñëè ïîïûòàòüñÿ ñäåëàòü ïðîñòåéøóþ çàìåíó â ýòîì ôàéëå, íàïðèìåð: $FILE = Get-Content test.bnk $NEWFILE = $FILE -replace "123", "" $NEWFILE | Set-Content test.bnk Ïðîáîâàë ìåíÿòü êîäèðîâêè íà âõîäå è íà âûõîäå, íå ïîìîãëî. Òàêæå ïðîáîâàë èñïîëüçîâàòü ìåòîä System.IO.Stream è òàì ñèòóàöèÿ òî÷íî òàêàÿ æå. |
|
Îòïðàâëåíî: 22:18, 28-04-2022 |
Ñòàðîæèë Ñîîáùåíèÿ: 250
|
Ïðîôèëü | Îòïðàâèòü PM | Öèòèðîâàòü ðàññêàæèòå ïîïîäðîáíåå ïðî ýòó âàøó ïðîñòåéøóþ çàìåíó
|
Îòïðàâëåíî: 04:20, 29-04-2022 | #2 |
Äëÿ îòêëþ÷åíèÿ äàííîãî ðåêëàìíîãî áëîêà âàì íåîáõîäèìî çàðåãèñòðèðîâàòüñÿ èëè âîéòè ñ ó÷åòíîé çàïèñüþ ñîöèàëüíîé ñåòè. Åñëè æå âû çàáûëè ñâîé ïàðîëü íà ôîðóìå, òî âîñïîëüçóéòåñü äàííîé ññûëêîé äëÿ âîññòàíîâëåíèÿ ïàðîëÿ. |
Ñòàðîæèë Ñîîáùåíèÿ: 193
|
Ïðîôèëü | Îòïðàâèòü PM | Öèòèðîâàòü ryok, äàéòå îáðàçåö ôàéëà.
|
Îòïðàâëåíî: 11:31, 29-04-2022 | #3 |
Íîâûé ó÷àñòíèê Ñîîáùåíèÿ: 22
|
Ïðîôèëü | Îòïðàâèòü PM | Öèòèðîâàòü Öèòàòà Serguei Kouzmine:
Ìíå æå íóæíî ñäåëàòü òî÷åíûå èçìåíåíèÿ â ôàéëå, áåç ïåðåçàïèñè âñåãî ôàéëà öåëèêîì. Öèòàòà Fors1k:
|
||
Îòïðàâëåíî: 13:12, 29-04-2022 | #4 |
Deadooshka Ñîîáùåíèÿ: 2517
|
Ïðîôèëü | Îòïðàâèòü PM | Öèòèðîâàòü ÷òî-òî òèïà ýòîãî íàâåðíîå. Ñòðîêà íå îäíîáàéòíàÿ â .net.
|
|
Îòïðàâëåíî: 13:19, 29-04-2022 | #5 |
Ñòàðîæèë Ñîîáùåíèÿ: 193
|
Ïðîôèëü | Îòïðàâèòü PM | Öèòèðîâàòü Öèòàòà ryok:
|
|
Îòïðàâëåíî: 13:21, 29-04-2022 | #6 |
Íîâûé ó÷àñòíèê Ñîîáùåíèÿ: 22
|
Ïðîôèëü | Îòïðàâèòü PM | Öèòèðîâàòü Sham,
Êîä èíòåðåñíûé, áóäó â íåì ðàçáèðàòüñÿ, ñïàñèáî. Fors1k, òåñòîâûé ôàéë ïðèêðåïèë, âîò õî÷ó â íåì ñäåëàòü çàìåíó : Îòðàáàòûâàåò íîðìàëüíî, íî ïðîãðàììà óæå îòêàçûâàåòñÿ ðàáîòàòü ñ òàêèì ôàéëîì, à åñëè ÿ ñàì çàéäó â ôàéë ÷åðåç Notepad++ è ïîìåíÿþ ýòó ñòðîêó <app-developer>0</app-developer> íà ýòó <app-developer>2</app-developer> òî âñå îê. |
Ïîñëåäíèé ðàç ðåäàêòèðîâàëîñü ryok, 30-04-2022 â 16:01. Îòïðàâëåíî: 16:31, 29-04-2022 | #7 |
Ñòàðîæèë Ñîîáùåíèÿ: 193
|
Ïðîôèëü | Îòïðàâèòü PM | Öèòèðîâàòü Êàê ÿ ïîíèìàþ, êîäèðîâêà èñõîäíîãî ôàéëà - ANSI.
Ïîïðîáóåì óêàçàòü å¸ ñòðîãî âðó÷íóþ. cls $pathIn = "C:\Users\Ps-2\Desktop\123\test.bnk" $pathOut = "C:\Users\Ps-2\Desktop\123\test_new.bnk" $ANSI = [Text.Encoding]::GetEncoding(1251) $old = [IO.File]::ReadAllText($pathIn, $ANSI) $new = $old.Replace('<app-developer>0', '<app-developer>2') [IO.File]::WriteAllText($pathOut, $new, $ANSI) # Ïðîâåðêà Start notepad $pathOut $oldFile = Get-Content $pathIn -TotalCount 1 -Delimiter "<?xml" $newFile = Get-Content $pathOut -TotalCount 1 -Delimiter "<?xml" Write-Host "Äî : $oldFile" Write-Host "Ïîñëå: $newFile" Write-Host -NoNewline "Ñèìâîëû â íà÷àëå ôàéëà èäåíòè÷íû? " $oldFile -eq $newFile |
Ïîñëåäíèé ðàç ðåäàêòèðîâàëîñü Fors1k, 29-04-2022 â 17:32. Îòïðàâëåíî: 17:13, 29-04-2022 | #8 |
Deadooshka Ñîîáùåíèÿ: 2517
|
Ïðîôèëü | Îòïðàâèòü PM | Öèòèðîâàòü get-content -raw / set-content -nonewline òîæå ìîãóò ðàáîòàòü. Íî áèíàðíûå äàííûå ýòî ìàññèâ áàéòîâ, à íå òåêñò.
|
Îòïðàâëåíî: 17:38, 29-04-2022 | #9 |
Ñòàðîæèë Ñîîáùåíèÿ: 193
|
Ïðîôèëü | Îòïðàâèòü PM | Öèòèðîâàòü Öèòàòà Sham:
|
|
Îòïðàâëåíî: 18:22, 29-04-2022 | #10 |
|
![]() |
Ó÷àñòíèê ñåé÷àñ íà ôîðóìå |
![]() |
Ó÷àñòíèê âíå ôîðóìà |
![]() |
Àâòîð òåìû |
![]() |
Ñîîáùåíèå ïðèêðåïëåíî |
| |||||
Íàçâàíèå òåìû | Àâòîð | Èíôîðìàöèÿ î ôîðóìå | Îòâåòîâ | Ïîñëåäíåå ñîîáùåíèå | |
CMD/BAT - Èñïîëüçîâàíèå ôàéëà ñ ðóññêèìè ñèìâîëàìè â .bat | vdvas | Ñêðèïòîâûå ÿçûêè àäìèíèñòðèðîâàíèÿ Windows | 6 | 13-06-2019 23:26 | |
Ëþáîé ÿçûê - ðåäàêòèðîâàíèå .xml ôàéëà | Bootman | Ñêðèïòîâûå ÿçûêè àäìèíèñòðèðîâàíèÿ Windows | 3 | 10-10-2017 21:28 | |
CMD/BAT - Ðåäàêòèðîâàíèå òåêñòîâîãî ôàéëà ñ íåñòàíäàðòíûìè ñèìâîëàìè. | semcrm | Ñêðèïòîâûå ÿçûêè àäìèíèñòðèðîâàíèÿ Windows | 7 | 03-06-2014 15:15 | |
Ðåäàêòèðîâàíèå swf ôàéëà | shveicar | Âåáìàñòåðó | 0 | 05-05-2012 15:32 | |
[ðåøåíî] ðåäàêòèðîâàíèå ôàéëà | .:TimoXa:. | AutoIt | 4 | 27-03-2009 08:29 |
|