Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. Remove Quote from Writeline output

Remove Quote from Writeline output

Scheduled Pinned Locked Moved Design and Architecture
adobedatabasesysadminhelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rfrank5356
    wrote on last edited by
    #1

    Hi - I have an app that reads a csv file line by line, parses for two fields, sends a query to a web server, receives four data fields back, and then writes an output line with the new fields followed by the contents of the input line. My problem is that the four fields are bracketed in quotes, and the entire input line is included in a set of quotes, so if I then open the output file with excel, the input line contents are treated as a single cell - not a series of csv fields. I then changed the code to loop through the fields and put commas in the string - but the output line still has quotes at the start and end of the string - so I I wan to use in Excel - I still need to open as a text file an strip out the pesky quotes. What to do ?? Here is the code doing the data assembly ID = ID + 1 WriteOutputLine = ID & "," & response.GeocodedAddresses(i).Alternatives(0).Quality.ToString & "," & HouseNo & "," & Street & "," & City & "," & State & "," & Zip & "," For DataFieldCount = 0 To lineArray.Length - 1 WriteOutputLine = WriteOutputLine & lineArray(DataFieldCount) & "," Next WriteLine(2, WriteOutputLine) Here is a sample input line . . 37.30840674,-122.0333179,-122.029614,37.30833842,1083.826,179,299,WGS 84,SCMAD20070713,Murky Pool,,7/13/2007 21:43,IMG_6212 copy_tag.jpg,IMG_6212 copy.jpg,,,585992.34,4129519.64,10 N,7/13/2007 14:43,,178.7832,100.2,,,,Canon Canon EOS DIGITAL REBEL XT Adobe Photoshop Elements 4.0 Windows Here is a sample output line "1,Exact,7360,Fallenleaf Ln,Cupertino,CA,95014,37.30840674,-122.0333179,-122.029614,37.30833842,1083.826,179,299,WGS 84,SCMAD20070713,Murky Pool,,7/13/2007 21:43,IMG_6212copy_tag.jpg,IMG_6212copy.jpg,,,585992.34,4129519.64,10 N,7/13/2007 14:43,,178.7832,100.2,,,,Canon Canon EOS DIGITAL REBEL XT Adobe Photoshop Elements 4.0 Windows," rfrank5356

    H 1 Reply Last reply
    0
    • R rfrank5356

      Hi - I have an app that reads a csv file line by line, parses for two fields, sends a query to a web server, receives four data fields back, and then writes an output line with the new fields followed by the contents of the input line. My problem is that the four fields are bracketed in quotes, and the entire input line is included in a set of quotes, so if I then open the output file with excel, the input line contents are treated as a single cell - not a series of csv fields. I then changed the code to loop through the fields and put commas in the string - but the output line still has quotes at the start and end of the string - so I I wan to use in Excel - I still need to open as a text file an strip out the pesky quotes. What to do ?? Here is the code doing the data assembly ID = ID + 1 WriteOutputLine = ID & "," & response.GeocodedAddresses(i).Alternatives(0).Quality.ToString & "," & HouseNo & "," & Street & "," & City & "," & State & "," & Zip & "," For DataFieldCount = 0 To lineArray.Length - 1 WriteOutputLine = WriteOutputLine & lineArray(DataFieldCount) & "," Next WriteLine(2, WriteOutputLine) Here is a sample input line . . 37.30840674,-122.0333179,-122.029614,37.30833842,1083.826,179,299,WGS 84,SCMAD20070713,Murky Pool,,7/13/2007 21:43,IMG_6212 copy_tag.jpg,IMG_6212 copy.jpg,,,585992.34,4129519.64,10 N,7/13/2007 14:43,,178.7832,100.2,,,,Canon Canon EOS DIGITAL REBEL XT Adobe Photoshop Elements 4.0 Windows Here is a sample output line "1,Exact,7360,Fallenleaf Ln,Cupertino,CA,95014,37.30840674,-122.0333179,-122.029614,37.30833842,1083.826,179,299,WGS 84,SCMAD20070713,Murky Pool,,7/13/2007 21:43,IMG_6212copy_tag.jpg,IMG_6212copy.jpg,,,585992.34,4129519.64,10 N,7/13/2007 14:43,,178.7832,100.2,,,,Canon Canon EOS DIGITAL REBEL XT Adobe Photoshop Elements 4.0 Windows," rfrank5356

      H Offline
      H Offline
      Hubert
      wrote on last edited by
      #2

      Have you tried windows version of sed or awk? They will strip quotes instead of you ;) Attached code shouldn't return quoted string, so i think quotes are added during saving to file. H.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups