debluzz
Junior Member
Thanks tsh73 I'll work with it.
Posts: 57
|
Post by debluzz on Jul 7, 2018 7:20:04 GMT -5
I have a file called current_6.txt. 7 2 4 5 5 9 30.96 1 8 3 6 4 5 10 31.09 1 6 6 7 5 5 14 31.57 1 8 3 4 4 3 3 30.94 1 6 3 3 2 2 1 30.88 1 1 6 5 7 7 10 31.24 1
I need to save the file as: lines1.txt I also need to save the file as lines1.dat
this is the program that opens the main file to be copied.
<>open "current_6.txt" for input as #1 record=6 while eof(#1)=0 line input #1, r$ print r$ i=i-1 wend close #1</>
|
|
|
Post by tenochtitlanuk on Jul 7, 2018 10:01:43 GMT -5
Not sure if you want to first modify the file. If not, the easy way is as follows- input the whole file into a single string of binary data, and write it twice with the desired names. NB the ';' makes sure you do not add an extra CRLF at the file ends.
nomainwin
open "current_6.txt" for binary as #fileIn content$ =input$( #fileIn, lof( #fileIn)) close #fileIn
open "lines1.txt" for binary as #fileOut1 open "lines1.dat" for binary as #fileOut2 #fileOut1 content$; #fileOut2 content$; close #fileOut1 close #fileOut2
end
|
|
debluzz
Junior Member
Thanks tsh73 I'll work with it.
Posts: 57
|
Post by debluzz on Jul 7, 2018 15:30:40 GMT -5
thank you, that is what was needed.
|
|
kevin
New Member
Posts: 13
|
Post by kevin on Jul 26, 2018 15:30:21 GMT -5
may this could help I'm not sure
I made this coe to backr up foes in a folder
you could look in the help file at copy delete move etc.
' Released as public domain.
nomainwin
struct SHFILEOPSTRUCT,_
hWnd as uLong,_
wFunc as Long,_
pFrom as ptr,_
pTo as ptr,_
fFlags as long,_
fAborted as long,_
hNameMaps as Long,_
sProgress as ptr
'--------------------------------------------------------
'sourceFolderName$ is the folder you want to copy.
'All sub-folders will be included.
'targetFolder$ is the name of the folder you want to copy sourceFolderName$ to.
'Do not include trailing delimiter \ when specifying folders.
style=0
sourceFolderName$="C:\Stop Wotch"
targetFolder$="H:\dummy"
if sourceFolderName$="" then END
call copyFolder sourceFolderName$,targetFolder$,style
cursor normal
END
SUB copyFolder sourceFolderName$,targetFolder$,style
SHFILEOPSTRUCT.pFrom.struct = sourceFolderName$;chr$(0)
SHFILEOPSTRUCT.pTo.struct = targetFolder$;chr$(0)
SHFILEOPSTRUCT.fFlags.struct = style
SHFILEOPSTRUCT.wFunc.struct = hexdec( "2") 'FO.COPY
CallDLL #shell32, "SHFileOperationA", _
SHFILEOPSTRUCT as STRUCT,_
ret as long
END SUB
Kevin
|
|