Posts: 128
Threads: 48
Joined: Jan 2007
hello,
i have a large file eg original.txt, i want to search for a specific argument, if found the whole line has to be copied to another file eg.. found.txt. can this be managed?
tia
freggel
Posts: 160
Threads: 43
Joined: Sep 2007
Try this i think it is what you need not sure
Function
Function13
str sFile="$desktop$\original.txt" ;;File name
str ArgumentToFind="Example";; Word looking for
str WildCard="*"
ArgumentToFind-WildCard;ArgumentToFind+WildCard
str s ss
ss.getfile(sFile)
foreach s ss
,if matchw(s ArgumentToFind 3)
,,out s
Posts: 160
Threads: 43
Joined: Sep 2007
or this i think is more what you want
Function
Function13
str sFile="$desktop$\original.txt" ;;File name
str ArgumentToFind="rn";; Word looking for
str destFolder="$desktop$\Found";;
str WildCard="*"
ArgumentToFind-WildCard;ArgumentToFind+WildCard
mkdir destFolder
destFolder+"\Found-%i.txt"
int j i
str s ss s3
ss.getfile(sFile)
foreach s ss
,i+1
,if matchw(s ArgumentToFind 3)
,,j+1
,,s3.format(destFolder j)
,,s.setfile(s3)
,,out s