概要
以下のようなjpgフォルダの中に様々な画像があります。
その中で、最も古いファイルだけを削除するにはどうすればいいでしょうか。
工程
- 指定したフォルダ内のファイル一覧(作成日時を含む)をデータテーブルとして取得
- 取得したデータテーブルを作成日順に昇順
- 最も古いファイルパスを削除
ワークフロー
概要
用意したワークフローは以下のとおりです。
データテーブルを構築
データテーブル変数「folder_DT」を以下のように構築します。
フォルダ内のファイルパスを繰り返し処理
System.IO.Directory.GetFilesメソッドで指定したフォルダ内のファイルパスを繰り返し取得
新規行にファイルパスと、作成日時を追加します。
プロパティ画面は以下の通りです。
以下のようにファイルパスと 作成日時のデータテーブルが生成されました。
データテーブルを作成日時順に並び替え
System.IO.Directory.GetFiles(“フォルダパス”)で取得されるディレクトリの順番はバラバラです。
ファイルシステムは2パターンあって、NTFSかFAT32のいずれかです。で、ファイルシステムがどちらかによって取得される順番は異なってきます。詳細は省略しますが、いずれにしても作成日時順に自動的になるわけではないです。
よって、 データを並び替えます。
最も古いファイルパスを削除
folder_DTの先頭行が最も古いファイルになったので、それを削除します。
※ゴミ箱からも削除されます。
無事に削除されました。
GitHubはこちら
感想
ほとんどUiPath独自のメソッドは使っておりません。すべてVB.NETなどでよく利用されているものばかりです。今度はVBAでも同じことをやってみようと思います。
73件のフィードバック
buying prescription drugs in mexico online: mexican pharmacy online – mexican rx online
You actually make it seem so easy along with your presentation but I to find this
topic to be really one thing which I feel I would never understand.
It seems too complex and very huge for me.
I am taking a look ahead for your subsequent submit, I will try to get the cling of it!
Escape room
Very interesting information!Perfect just what I was searching
for!?
buying prescription drugs in mexico: mexican pharmacy – mexico drug stores pharmacies
mexico pharmacies prescription drugs: buying from online mexican pharmacy – mexico pharmacy
canadian pharmacy scam: pet meds without vet prescription canada – safe canadian pharmacy
top online pharmacy india: indian pharmacy paypal – top online pharmacy india
legitimate canadian online pharmacies: canadian pharmacy meds – canadian pharmacy no scripts
canadian mail order pharmacy: best canadian pharmacy – legit canadian pharmacy
mexican online pharmacies prescription drugs: buying from online mexican pharmacy – buying prescription drugs in mexico
mexican pharmaceuticals online: mexico pharmacy – purple pharmacy mexico price list
my canadian pharmacy review: canadian medications – canadian online drugstore
mexican mail order pharmacies: mexican mail order pharmacies – mexican drugstore online
https://ciprodelivery.pro/# ciprofloxacin generic price
http://clomiddelivery.pro/# buying generic clomid
paxlovid for sale [url=https://paxloviddelivery.pro/#]paxlovid cost without insurance[/url] paxlovid pharmacy
https://paxloviddelivery.pro/# paxlovid pill
https://amoxildelivery.pro/# antibiotic amoxicillin
paxlovid for sale [url=https://paxloviddelivery.pro/#]paxlovid price[/url] paxlovid pharmacy
http://amoxildelivery.pro/# amoxicillin brand name
https://ciprodelivery.pro/# buy cipro
generic doxycycline online [url=http://doxycyclinedelivery.pro/#]doxycycline usa[/url] doxycycline tablets in india
http://doxycyclinedelivery.pro/# doxycycline 40 mg india
http://doxycyclinedelivery.pro/# can i buy doxycycline over the counter
ciprofloxacin [url=https://ciprodelivery.pro/#]ciprofloxacin mail online[/url] where can i buy cipro online
https://paxloviddelivery.pro/# paxlovid pill
https://ciprodelivery.pro/# ciprofloxacin mail online
generic clomid without a prescription [url=http://clomiddelivery.pro/#]can i get clomid without prescription[/url] where can i buy clomid without insurance
https://amoxildelivery.pro/# amoxicillin online pharmacy
http://ciprodelivery.pro/# ciprofloxacin order online
https://amoxildelivery.pro/# order amoxicillin uk
amoxicillin 500 mg tablet [url=https://amoxildelivery.pro/#]amoxicillin 500 mg cost[/url] buy amoxicillin 500mg capsules uk
https://doxycyclinedelivery.pro/# doxycycline price usa
https://doxycyclinedelivery.pro/# doxycycline 20 mg capsules
doxycycline nz cost [url=https://doxycyclinedelivery.pro/#]doxycycline hyclate 100 mg cap[/url] doxycycline with out a rx
I respect your work, thanks for all the interesting content.
indian pharmacy: india pharmacy – cheapest online pharmacy india
buying prescription drugs in mexico: purple pharmacy mexico price list – purple pharmacy mexico price list
mexican online pharmacies prescription drugs: best online pharmacies in mexico – mexico drug stores pharmacies
mexico drug stores pharmacies: mexican border pharmacies shipping to usa – medicine in mexico pharmacies
search rx pharmacy discount card: cost of lipitor at target pharmacy – ventolin target pharmacy
best india pharmacy: indian pharmacy – top online pharmacy india
people’s pharmacy zoloft: viagra pharmacy checker – celebrex pharmacy prices
indian pharmacies safe: cheapest online pharmacy india – top 10 pharmacies in india
india pharmacy: pharmacy website india – india pharmacy
farmacia online envГo gratis: farmacias baratas online envio gratis – farmacia online envГo gratis
farmacia online envГo gratis: cialis en Espana sin receta contrareembolso – farmacias online baratas
farmacias online seguras en espaГ±a: gran farmacia online – farmacia online barata
viagra para hombre venta libre: comprar viagra – sildenafilo 50 mg comprar online
farmacia online senza ricetta: Farmacie online sicure – farmaci senza ricetta elenco
viagra 100 mg prezzo in farmacia: viagra senza prescrizione – viagra originale recensioni
Farmacie on line spedizione gratuita: Farmacie online sicure – п»їFarmacia online migliore
comprare farmaci online all’estero: Farmacia online migliore – Farmacia online miglior prezzo
farmacie online affidabili: Cialis generico prezzo – comprare farmaci online all’estero
acquisto farmaci con ricetta: Cialis generico 5 mg prezzo – farmacia online senza ricetta
Farmacia online piГ№ conveniente: Farmacie on line spedizione gratuita – farmacia online
furosemide 100 mg: buy furosemide – lasix furosemide 40 mg
buy rybelsus: rybelsus price – Semaglutide pharmacy price
Buy compounded semaglutide online: buy semaglutide online – Semaglutide pharmacy price
average cost of prednisone 20 mg: prednisone 5093 – buy prednisone without prescription paypal
escrow pharmacy canada: Cheapest online pharmacy – maple leaf pharmacy in canada
canadian pharmacy online: canada pharmacy online – legitimate canadian online pharmacies
canadian online pharmacy [url=https://canadapharma.shop/#]Cheapest online pharmacy[/url] maple leaf pharmacy in canada
mexico drug stores pharmacies https://mexicanpharma.icu/# buying from online mexican pharmacy
mexican rx online
rybelsus pill: rybelsus coupon – semaglutide tablets
buy ozempic pills online: ozempic – ozempic cost
buy ozempic: ozempic online – ozempic generic
buy ozempic pills online: buy ozempic pills online – ozempic coupon
ozempic coupon: buy ozempic pills online – Ozempic without insurance
semaglutide tablets: rybelsus coupon – semaglutide online
rybelsus coupon: cheapest rybelsus pills – rybelsus price
cheapest rybelsus pills: buy rybelsus online – semaglutide tablets
cheapest rybelsus pills: semaglutide online – semaglutide cost
ozempic coupon: buy ozempic pills online – ozempic generic
Ozempic without insurance: ozempic coupon – buy ozempic pills online
buy semaglutide online: semaglutide tablets – rybelsus coupon
buy semaglutide pills: cheapest rybelsus pills – buy semaglutide online
ozempic generic: buy ozempic – Ozempic without insurance
https://gabapentin.auction/# neurontin medication
https://amoxil.llc/# amoxicillin generic