Advertisement

01.04.2007 at 10:29AM PST, ID: 22111170
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Need a Windows Script Host VBScript File that Moves a Text File...

Asked by Osoccers in Visual Basic Programming, VB Script

Tags: , , ,

...to a different folder and in the relocated file concatenates all of the lines in one long string with a space between each line element.  Here is a fuller statement of the problem:

I need a Visual Basic Script file, call it "Move and Reformat Text File.VBS," that will run from a Windows Script Host command-prompt-based version as follows:

C:\>  Cscript.exe "Move and Reformat Text File.VBS"

The objective of the VBScript file, "Move and Reformat Text File.VBS,” is to move a text file from an input folder, "C:\Input\,” to an output folder, "C:\Output\,” but with all lines of the original file concatenated to a single string, and with a space inserted between the line elements.

For example, say, the input file is "C:\Input\1.TXT" and it contains the following lines:

Line_1
Line_2
 . . .
Line_n

Then I want to create a corresponding output file "C:\Output\1.txt" that contains a single line, i.e., one string, as follows:

Line_1 Line_2 . . . Line_n

Note the single space inserted between each line.

After this is done, delete the input file, "1.TXT " from the "C:\Input\" folder.

Do this procedure for each *.TXT file in the input folder.

Also, sense when a new text file is added to the "C:\Input\" folder and run the procedure again.  Or, if it is not feasible to program that, then at least invoke "Move and Reformat Text File.VBS" periodically, say, every five minutes.

In summary, here is the pseudo code outline of the procedure I envision:

For each text file in the input folder
  - Create a new, blank, output text file of the same name as the input file.
  - Save the new output text file in the output folder.
  - Concatenate all the lines of the input file to one string.
  - Append the concatenated string in the new output text file.
  - Close the output text file.
  - Delete the input text file.

Thanks for your help.
Start Free Trial
[+][-]01.04.2007 at 10:41AM PST, ID: 18245317

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.04.2007 at 11:04AM PST, ID: 18245530

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.04.2007 at 11:08AM PST, ID: 18245556

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.04.2007 at 11:10AM PST, ID: 18245579

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Basic Programming, VB Script
Tags: file, vbscript, text, windows
Sign Up Now!
Solution Provided By: rettiseert
Participating Experts: 3
Solution Grade: A
 
 
[+][-]01.04.2007 at 11:24AM PST, ID: 18245713

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.04.2007 at 11:27AM PST, ID: 18245749

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.04.2007 at 11:47AM PST, ID: 18245950

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.04.2007 at 02:10PM PST, ID: 18247295

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.04.2007 at 02:39PM PST, ID: 18247544

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32