Solved

VB Script - Need altered a bit

Posted on 2013-01-17
7
252 Views
Last Modified: 2013-02-05
I have a vb script that looks for a number in some files.  However now I need it altered to look at column 3 of the files in the 'data_files_to_splice.txt' file.  I updated this file to point to Column 3.  However when I put the string around quotes in the array line, it doesn't return any rows.  I suspect that line needs tweaked?  Attached is the current script.
splice-years.vbs
0
Comment
Question by:elwayisgod
  • 4
  • 2
7 Comments
 
LVL 21

Assisted Solution

by:AmazingTech
AmazingTech earned 250 total points
ID: 38788676
arrYears = Array( "Style 01 1 13 131 00 00 768780" )

Only puts in 1 array value of "Style 01 1 13 131 00 00 768780"

Perhaps you're looking for

arrYears = Split( "Style 01 1 13 131 00 00 768780", " " )

or

arrYears = Array( "Style", "01", "1", "13", "131", "00", "00", "768780" )

But duplicate 00 wouldn't be necessary.
0
 

Author Comment

by:elwayisgod
ID: 38789539
Didn't work..  It's one field thus not sure...
0
 
LVL 54

Expert Comment

by:Bill Prew
ID: 38790415
I think I would want to see the script before you changed it, and what the input file looks like.

~bp
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

Author Comment

by:elwayisgod
ID: 38810470
Script just had  '2012', '2013' etc..  for array.  That's only change.
0
 
LVL 54

Accepted Solution

by:
Bill Prew earned 250 total points
ID: 38816034
I would like to try and help you with this, but I really don't understand what you are trying to accomplish.  If the arrYears was something like this before:

arrYears = Array( "2012", "2013", "2015" )

then why would changing it to the below relate to changing a column number?

arrYears = Array( "Style 01 1 13 131 00 00 768780" )

And what is in the "data_files_to_splice.txt", as well as some of the files that it references?

~bp
0
 

Author Comment

by:elwayisgod
ID: 38831169
That new string to look for is in a different column which is ok as the text files controls it.... Nt really sure how to proceed......
0
 

Author Closing Comment

by:elwayisgod
ID: 38857514
Splitting points as it's dead question....Sorry.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question