Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Thanks! Awesome group. I put out a simple question in the access/vba forum that I couldn't find answered on technet or anywhere else on the web and it was answered the same day!!..."

Geography

Where in the world do Tek-Tips members come from?

Create a VBScript for generated .csv file

niso007 (TechnicalUser)
19 Apr 12 6:31
Hi,

We get a file dump of a .CSV file every morning which we need to modify.

 1. Delete all rows in column S that has the value "64".
 2. Delete columns A, B, C, E, H, J, L, N, O, Q and S
 3. Copy contacts from another Excel file into last row of this        file.
 4. Save the file from .CSV to .XLS.

Could anyone help us with this? Our scripting skills are low...

Thanks in advance.
jges (TechnicalUser)
19 Apr 12 8:48
Do you have Excel installed? This might be easier using VBScript to automate Excel, or just using an Excel VBA macro (no VBScript).
Geates (Programmer)
19 Apr 12 9:25
CSVs are just comma separated text.  You can use the FileSystemObject like you would any other text file.  Although, some of you operations may be more easily accomplished using a record set or the Excel object.  If you use FSO, besure to strip and re-add the quote encapsulation and comma separator.  Open the CSV in notepad, it will look how VBS would read it if using the FSO.

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again.  Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 

jges (TechnicalUser)
19 Apr 12 13:44
Does your csv file have a header row?
How many columns of data do you have?

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close