Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a VBScript for generated .csv file

Status
Not open for further replies.

niso007

Technical User
Apr 19, 2012
1
NO
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.
 
Do you have Excel installed? This might be easier using VBScript to automate Excel, or just using an Excel VBA macro (no VBScript).
 
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
 
Does your csv file have a header row?
How many columns of data do you have?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top