473,385 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

VBS script required to remove " from .ttx file

63
I have a file that is stored in C:\users\123456\ with the name export.ttx . I want to create a VBS script that opens up this file, removes all the " in the file (and replaces these " with nothing)and then saves down the amended file as a .csv file. I am not sure where to start. To be clear I want the rest of the file contents to be unchanged - I only want to remove the "'s. Can anyone offer any help?
thanks
Apr 29 '14 #1

✓ answered by Luk3r

Edit**: I felt bad for giving you direction toward VB.NET so I'm including code for a vbscript that will literally do exactly what you want. Let me know how it goes:

Expand|Select|Wrap|Line Numbers
  1. Const ToRead = 1
  2. Const ToWrite = 2
  3.  
  4. Set FSO = CreateObject("Scripting.FileSystemObject")
  5. Set File = FSO.OpenTextFile("c:\directory\export.txt", ToRead)
  6.  
  7. readText = File.ReadAll
  8. File.Close
  9. readText = Replace(readText, """", "")
  10. Set File = FSO.OpenTextFile("c:\directory\export.txt", ToWrite)
  11. File.WriteLine readText
  12. File.Close
  13.  
  14. FSO.MoveFile "c:\directory\export.txt", "c:\directory\export.csv"

3 1398
Luk3r
300 256MB
Edit**: I felt bad for giving you direction toward VB.NET so I'm including code for a vbscript that will literally do exactly what you want. Let me know how it goes:

Expand|Select|Wrap|Line Numbers
  1. Const ToRead = 1
  2. Const ToWrite = 2
  3.  
  4. Set FSO = CreateObject("Scripting.FileSystemObject")
  5. Set File = FSO.OpenTextFile("c:\directory\export.txt", ToRead)
  6.  
  7. readText = File.ReadAll
  8. File.Close
  9. readText = Replace(readText, """", "")
  10. Set File = FSO.OpenTextFile("c:\directory\export.txt", ToWrite)
  11. File.WriteLine readText
  12. File.Close
  13.  
  14. FSO.MoveFile "c:\directory\export.txt", "c:\directory\export.csv"
Apr 29 '14 #2
grego9
63
I am a bit of a novice with VBS so I'm not sure what the difference is betweem VBS and VB.net!
Apr 29 '14 #3
grego9
63
Works perfectly! Thank-you so much, that will save me a lot of time!
Apr 29 '14 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: StevePBurgess | last post by:
I would like to make my downloads section unbrowsable (to users) but accessible to scripts. Can I deliver a file to a browser without linking to it's URL so that I can deliver files...
11
by: Konrad Den Ende | last post by:
I have a script placed somewhere in the body of my HTML-doc. I noticed that i'll be using the very same script in a large number of document (all of them as the script regards the time of the most...
1
by: Kishor | last post by:
Hi, I have developed an assembly, now it the the time to build the setup for assembly. I have created Setup project. I have added necessary files, created shortcuts... etc. when I started build,...
1
by: Denton | last post by:
Hi all: I working in MS window environment. Now I want to use a python script to import some data from CSV file to MDB file. but I have some problems about creating MDB file in DAO. I am using...
4
by: Chicagoboy27 | last post by:
All I am trying to find a solution for removing the ?returnUrl if a user is not authenticated. I want to be redirect an unauthenticated user to the login.aspx less the returnUrl. Once they log...
1
by: UJ | last post by:
Can anybody tell me how to tell what codec is required for a file programmatically. I will have users uploading a file to our server and I want to limit the codecs we allow because the machine that...
1
by: ajay m | last post by:
hi.. i am new to perl, i need a perl script for adding a file from local machine to perforce version control.... plz help me....
2
by: Sarahshalaby | last post by:
hi i have a problem in removing a file with a variable name. i know the function remove("file.txt") takes a string. what can i do to make it take a variable. or is there another function to...
3
by: Okonita via DBMonster.com | last post by:
Hi all, Working on a little shell script to remove specific records from a flat file. I have scanned a one or two script books and googled for answers but have no success. Can someone show me how...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.