Results 1 to 4 of 4

Can I export rows of text to a .sas file WITHOUT quotation marks?

Threaded View

pehsh Can I export rows of text to... 06-30-2016, 10:32 AM
Kaper Re: Can I export rows of text... 07-02-2016, 01:33 AM
pehsh Re: Can I export rows of text... 07-02-2016, 06:27 AM
Kaper Re: Can I export rows of text... 07-03-2016, 01:26 PM
  1. #1
    Registered User
    Join Date
    06-30-2016
    Location
    Copenhagen
    MS-Off Ver
    2013
    Posts
    2

    Can I export rows of text to a .sas file WITHOUT quotation marks?

    Hi,

    I'm wrestling with making a tool to correct often used phrases in SAS code, and then creating a new SAS file with the corrections (or, ideally, overwriting the original). I can read the SAS file, paste it as a cell per row going down, and correct the phrases.

    My problem is exporting the rows to a .sas file without adding quotations. This seems to be happening as I'm saving to a new file (so a search and replace beforehand, won't solve the problem).

    I've used https://www.extendoffice.com/documen...a-to-text.html as a guide.

    My export sub is:
    Sub Export()
    
        Dim wb As Workbook
        Dim saveFile As String
        Dim WorkRng As Range
        Dim Exp As Integer
        
        On Error Resume Next
        Set WorkRng = Application.Selection
        Set wb = Application.Workbooks.Add
        WorkRng.Copy
        wb.Worksheets(1).Paste
        saveFile = Application.GetSaveAsFilename(fileFilter:="SAS files (*.sas), *.sas")
        wb.SaveAs Filename:=saveFile, FileFormat:=xlText, CreateBackup:=False
        wb.Close
        Application.CutCopyMode = False
        Application.DisplayAlerts = False
        Application.ScreenUpdating = True
        
    End Sub
    Which works fine for creating SAS file, but adds the quotation marks like so
    "/*libname _input  ""&srvpath.\&user_envir.\source\test"";
    which should just be (there are quotation marks in the SAS code)
    /*libname _input  "&srvpath.\&user_envir.\source\test";
    I hope some of you can help me!
    Cheers
    Last edited by pehsh; 06-30-2016 at 10:35 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Exporting to text file from Excel with quotation marks
    By MikeFranz123 in forum Excel General
    Replies: 0
    Last Post: 11-02-2014, 05:00 AM
  2. Replies: 0
    Last Post: 11-09-2011, 01:31 AM
  3. Excel adding quotation marks when saving text file
    By theaudiobookguy in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 08-01-2009, 08:26 PM
  4. [SOLVED] Removing quotation marks in a txt-file
    By Reedhill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2006, 03:20 PM
  5. CSV File and Maintaining Quotation Marks in TXT
    By rammstein in forum Excel General
    Replies: 0
    Last Post: 02-23-2006, 06:18 PM
  6. [SOLVED] how do I remove quotation marks from .CSV file
    By Ratty in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-23-2005, 11:05 AM
  7. Replies: 3
    Last Post: 01-26-2005, 10:07 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1