'================================================== ' WeekCLN for WIN10 ' For SortFunction for spread Sheet SoftWear ' Ver 0.01 ' Copy right Miyama. 2025 April ' http://kazutomimiyama.sakura.ne.jp ' KazutomiMiyamaSub@gmail.com '================================================== Option Explicit On Public Class Form1 Private Sub GoBtn_Click(sender As Object, e As EventArgs) Handles GoBtn.Click Dim FSO As Object = CreateObject("Scripting.FileSystemObject") Dim RTS As Object Dim WTS As Object Dim ResorceFileName As String = "outsort.txt" Dim ResultFileName As String = "outTuned.csv" Dim MSGSTR As String = "前回の出力結果が残っています。上書を避けるためリネームしてください。" + "ResultFile exists already, Please rename it." Dim tmpBuf As String Dim EleSTR() As String Dim i, j, L As Integer Dim VacantChr As String = "" Dim EleFixedSTR(3 + 1) As String For j = 0 To 3 EleFixedSTR(j) = VacantChr Next If FSO.fileexists(ResorceFileName) = False Then MessageBox.Show("ファイルがありません。 No SorceFile, outsort.txt") Else If FSO.fileexists(ResultFileName) = True Then MessageBox.Show(MSGSTR) Else RTS = FSO.Opentextfile(ResorceFileName) WTS = FSO.CreatetextFile(ResultFileName) Do While (RTS.atendofstream = False) tmpBuf = RTS.readline EleSTR = Split(tmpBuf, ",") 'cumma If 0 <= EleSTR.Length And EleSTR.Length < 4 Then 'vacant save EleFixedSTR(3) = VacantChr EleFixedSTR(2) = VacantChr EleFixedSTR(1) = VacantChr EleFixedSTR(0) = EleSTR(0) 'Date Save always Else For i = 0 To 3 If Not i = 3 Then If EleSTR(i) = VacantChr Then EleSTR(i) = EleFixedSTR(i) ' before data call Else EleFixedSTR(i) = EleSTR(i) ' new data input End If Else 'i=3 If EleSTR(3) = VacantChr Then EleFixedSTR(3) = VacantChr ' Price data nothing EleFixedSTR(2) = VacantChr ' then all cllear other element EleFixedSTR(1) = VacantChr ' but not deleate data string Else EleFixedSTR(3) = EleSTR(3) ' new data input(price) End If End If Next i End If For L = 0 To 3 WTS.write(EleFixedSTR(L) + ",") 'cumma Next L WTS.write(vbCrLf) Loop RTS.close WTS.close End If End If End Sub Private Sub ExitBtn_Click(sender As Object, e As EventArgs) Handles ExitBtn.Click Me.Close() End Sub End Class '================================================== ' end of file '==================================================