Hi PHV,
I am using VBScript for "IBM Personal Communications 5.7
emulator for AS/400". Can I still use the FileSystemObject for accessing a text file? I see the emulator macro needs special code like " autECLSession.autECLPS.WaitForAttrib"...
Hi PHV,
Can you give the sample codes for the following:
*********************************************
Open "C:\MBRID.TXT" For Input As #1 ' HITS
HERE!!!!!!!!!!!!!!!!!
While Not EOF(1)
Line Input #1, mbrid
If mbrid <> " " Then
...
...
Hi all,
I am writing a macro ( .mac) to be used in IBM Personal Communications 5.7
emulator for AS/400. The macro is to read text
from a text file (MBRID.TXT) and perform a routine in the macro as follow:
*******************************************************************************...
Hi strebor,
After the VBS run, the myNewFile.txt result file will have an extra empty line at the end of the file. How can I make it to stop the cursor at the end of the last content line?
Please advise and Thank you.
Hi strebor,
The code is great! It combines the files content properly. How can change the code to only pick up TEXT files (*.txt) in the C:\appendingfolder , but excluding the myNewFile.txt result file, which resides in the same folder as the rest of the Text files?
Hi sparkbyte,
Thanks for...
Hello,
I normally use FTP (IP address) to load file into the AS/400 system. How can I automate the following:
OPEN
FTP 9.9.9.9
User
Password
PUT FILE.MEMBER
BYE
I would like the above file (either batch or script) to prompt for USER and PASSWORD interactively (instead of storing them in...
Hello,
Can anyone tell me why when I merge files contents, there's always the square sign at the beginning and end of file?
Please advise and Thank you.
HI sparkbyte,
Thank you for the code. I will try it out. Do you know how can I execute FTP commands in VBScript?
The FTP commands that I wanna include are as follow:
OPEN
FTP 127.0.0.1
PUT PROCESS.TXT
BYE
After I have FTP the IP address, it will ask me to enter the USER ID and PASSWORD...
Hi tsuji,
<[1] Make a single line (just a carriage return) file>
Can you advise how the above file with the carriage return is done? I opened up a txt file and enter press the Enter key to go to the next line. Then saved and name it as singleline.xxx.
Is the above correct?
Please advise and...
Hi tsuji,
I tried the following codes:
c:
cd c:\suppin
del process.txt
for %%a in (*.txt) do copy /b process.xxx+%%a+singleline.xxx process.xxx
rename process.xxx process.txt
with the following files in the folder:
process.xxx EMPTY
singleline.xxx ONE SINGLE LINE
After the above batch...
Hi tsuji,
I get your point now. Thanks for the explanation. However, in my case, I wouldn't know how many files or the file names that I wanna add to the PROCESS.TXT file. All I know is that there are text files.
Please advise and Thank you.
Hi tsuji,
Can you please elabrote on how to use COPY and APPEND to achieve the goal? I don't get the meaning.
Another thing also, I can't use the /B for COPY command, as it indicates it is a binary file. The output text file (PROCESS.TXT) is to be an ASCII file.
Thank you.
Hi tsuji,
The text files that were provided do not have the additional blank line at the end of each file.
Can I know what do you mean by "+ appending"? Which command?
Thank you.
Hi tsuji,
Great! Now the funny character is not there. But it still appears as one string as follow:
Test-1Test-2Test-3
How do I make it look like the original files content as follow:
Test-1
Test-2
Test-3
Please advise and Thank you.
Hi PHV,
I have the following contents in the following text files:
test1.txt
Test-1
test2.txt
Test-2
test3.txt
Test-3
The I ran the following test.bat file:
COPY /Y /A c:\suppin\*.txt c:\suppin\process.txt
I got the following content in the PROCESS.TXT file:
Test-1Test-2Test-3
I also...
Hi PHV,
I added /A to indicate that it is an ASCII file, but the output is still the same, ie. the it appears a one string and the funny character is still there.
COPY /Y /A \path\to\input\*.txt \path\to\output\process.txt
Please advise.
Hi PHV,
I tried the following in a .bat file as advised:
COPY /Y \path\to\input\*.txt \path\to\output\process.txt
It copies contents from all the text files and store into PROCESS.TXT file. However, it joins all the contents as a single string and added a funny character at the end of the...
Hi barny2006,
Thanks for the prompt reply. I tried the code. It copies all the text filenames (eg. test1.txt, test2.txt and test3.txt) and store it into the PROCESS.TXT file.
I would like to copy all the CONTENT of the test filenames (ie. test1.txt, test2.txt and test3.txt) and store them into...
Hello,
I need to automate the following, using scripting language (VBSCRIPT):
Copy all the contents of text files in a folder and paste all the contents to a text file (PROCESS.TXT).
Please advise and Thank you.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.