Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6356039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:53:15+00:00 2026-05-24T22:53:15+00:00

I need to modify strings in two CSV files. I am using Windows XP.

  • 0

I need to modify strings in two CSV files. I am using Windows XP.

The file names are pi_jobs.csv and pi_offices.csv.

I require two blank spaces between each record, and then two blank rows after the last record.

The files are generated by an Access-based application, and I’ve been able to create the blank rows in the output via the SQL statement (basically, the last field in the query concatenates two sets of Chr(10) and Chr(13) characters, giving me two line feeds and two carriage returns).

However, when I output the files to CSV it includes those carriage returns and line feeds as a separate field in the record, and thus puts a comma before the field, and quotes around the field.

I’ve provided an example below. Note gap between the first and second record. There is a comma and quotation mark at the end of the first record, and a closing quotation mark before the start of the second record:

“An accredited Medical Assisting program where eligible to receive either AAMA or AMT certification; High School Diploma or GED required; Minimum of three years work experience in a medical or related business office; Working knowledge of phlebotomy and administering injections. Desired: Associates Degree.”,”


”

“TBP20113105-82792″,”chicago-edgewater”,”9999999″,”TBP Medical Assistant”

I’ve been very careful with my page formatting here – that is exactly how the line spacing looks. There are three line gaps in that spacing. It should, however, look like this:

“An accredited Medical Assisting program where eligible to receive either AAMA or AMT certification; High School Diploma or GED required; Minimum of three years work experience in a medical or related business office; Working knowledge of phlebotomy and administering injections. Desired: Associates Degree.”

“TBP20113105-82792″,”chicago-edgewater”,”9999999″,”TBP Medical Assistant”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:53:16+00:00Added an answer on May 24, 2026 at 10:53 pm

    Here is a pure Access solution.

    Step 1: Add reference to Microsoft Scripting Runtime library in your database

    enter image description here

    Step 2: Create a function that will open the table/query and read the records line-by-line and outputs to .csv file

    Function OutputToCsv()
    Dim fs As FileSystemObject
    Dim ts As TextStream
    Dim rs As Recordset
    
    On Error GoTo lberr
    
    'use this if you query a single table
    Set rs = CurrentDb.OpenRecordset("Select Column1, Column2, Column3 From NewTable")
    
    'use this if your query DOES NOT have any parameters
    'Set rs = CurrentDb.OpenRecordset("Select Column1, Column2, Column3 From NewQuery")
    
    'use this if you use query WITH parameter(s)
    'Dim qdf As QueryDef
    'Set qdf = CurrentDb.QueryDefs("NewQuery")
    'qdf.Parameters("Parameter1") = "" 'set the value for the parameter(s)
    'Set rs = qdf.OpenRecordset
    
    If (rs.RecordCount = 0) Then Exit Function
    
    Set fs = New FileSystemObject
    Set ts = fs.CreateTextFile("C:\NewFile.csv", True, False) 'this will overwrite the file each time
    
    rs.MoveFirst
    
    Do While Not rs.EOF
        'Chr(34) is a quotation mark "
        ts.WriteLine (Chr(34) & rs("Column1") & Chr(34)) 'format your record output
        'ts.WriteLine (Chr(34) & rs("Column1") & Chr(34) & "," & Chr(34) & rs("Column2") & Chr(34)) 'in case you need to output more than one column
        ts.WriteBlankLines (2) 'Add as many empty lines as you need
        rs.MoveNext
    Loop
    
    ts.Close
    
    MsgBox "Success!"
    
    Exit Function
    lberr:
        MsgBox Err.Description
    End Function
    

    And, this is how your output file should look like:

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to modify a (xml-)file from Apache Ant. loadfile task allows to load
I need to modify an MSI file, and I'd like to do it in
I have a windows service that reads from a config file. I need to
I need to modify the content of certain HttpRequests (SSAS connection strings) in IIS.
Since I need to allow my users, to search strings with white spaces, I
I need to modify the following MySQL statement to include information from a third
I need to modify the contents of the child rows of a hierarchical Infragistics
I need to modify the lm (or eventually loess ) function so I can
I need to modify a php search script so that it can handle multiple
I need to modify a column in a SQLite database but I have to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.