0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

vbs split()

Last updated at Posted at 2017-02-08

jkの取り出し
2行目777の追加

sub myTest
Input ="abc,def" & vbcrlf & "ghli,jk" & vbcrlf & "lm" & vbcrlf
Output=SplitToridasi(Input,vbcrlf,",",1,1)
msg Output
Output=SplitGyomatuTuika(Input,vbcrlf,",",1,"777")
msg Output
end sub
'取り出し------------------------------------------------------------
function SplitToridasi(dataN,RS,FS,i,j)
aryStrings  = Split(dataN,RS)
aryStrings2 = Split(aryStrings(i),FS)
SplitToridasi = aryStrings2(j)
end function
'行末追加------------------------------------------------------------
function SplitGyomatuTuika(dataN,RS,FS,i,Tuika)
aryStrings  = Split(dataN,RS)
aryStrings(i)=aryStrings(i) & FS & Tuika
SplitGyomatuTuika=""
for i = 0 to UBound(aryStrings)-1
SplitGyomatuTuika=SplitGyomatuTuika & aryStrings(i) & RS
next
end function

(参考)

(注意)i,j入力のチェックは行っていません。
①「取り出し」「行末追加」は,英語で何といいますか?
②同じ機能のpython関数を探しています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?