120.times do |i|
fn = "rb/dummy%03d.zip" % i
File.open(fn, "w") do |outfile|
outfile.puts ""
end
end
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
for i in range(0, 120):
with open("py/dummy{0:03d}.zip".format(i), "w"):
pass
if __name__ == '__main__':
main()
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
)
func init() {
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
}
func main() {
for i := 0; i < 120; i++ {
filepath := fmt.Sprintf("go/dummy%03d.zip", i)
var b []byte
err := ioutil.WriteFile(filepath, b, os.ModePerm)
if err != nil {
log.Fatal(err)
}
fmt.Println("<" + filepath + "> is created.")
}
}
vbscript 指定したファイルの全てのシートについてA1セルを有效にするスクリプト
Option Explicit
'/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
'指定したエクセルファイルの全てのシートのセルをA1セルへ移動するスクリプト
'エクセルの指定はダイアログ、D&Dをサポート
'/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Call ActivateA1
Private Sub ActivateA1()
Dim objExcel
'起動中のExcelの流用を優先します。
On Error Resume Next
Set objExcel = WScript.GetObject(, "Excel.Application")
If Err.Number <> 0 Then
Err.Clear
On Error GoTo 0
Set objExcel = WScript.CreateObject("Excel.Application")
End If
objExcel.Visible = True
Dim args
Set args = WScript.Arguments
Dim filePath
If args.length > 0 Then
filePath = args(0)
End If
If filePath = "" Then
filePath = objExcel.GetOpenFilename("Excelファイル,*.xls;*.xlsx")
If filePath = "False" Then
Exit Sub
End If
End If
Dim xWB, xBook
Set xWB = Nothing
For Each xBook In objExcel.Workbooks
If xBook.Path & "\" & xBook.Name = filePath Then
Set xWB = xBook
Exit For
End If
Next
If xWB Is Nothing Then
Set xWB = objExcel.Workbooks.Open(filePath)
End If
objExcel.ScreenUpdating = False
Dim xSheet
For Each xSheet In xWB.Worksheets
If xSheet.Visible then
xSheet.Activate
Call objExcel.Goto(xSheet.Range("A1"), True)
End If
Next
xWB.Worksheets(1).Activate
objExcel.ScreenUpdating = True
MsgBox "問題がなければ保存してください。"
' objExcel.WindowState = -4137 'max
objExcel.WindowState = -4143 'min
End Sub