Author Topic: How do I get rid of spaces in a CSV file?  (Read 912 times)

Offline hmills

  • Associate
  • **
  • Posts: 2
  • Forum Citizenship: +0/-0
How do I get rid of spaces in a CSV file?
« on: 03 Oct 2007 09:35:43 pm »
Hi,

I am outputting a report to a CSV file which looks like the following when opened in textpad:

saacct,lbmatstat,party_cd,sasplitid,lbtrntyp,snsecref,lbsecref,lbsecdesc,lbtraddate,lbsetdate,
231085          ,CANCELLED       ,AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,1215628201,BUY             ,
231085          ,CANCELLED       ,AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,1215628202,BUY             ,
231085          ,CANCELLED       ,BBBBBBBBBBBBBBBBBBBBBBBBBBBB    ,1217285601,SS              ,
231085          ,CANCELLED       ,BBBBBBBBBBBBBBBBBBBBBBBBBBBB    ,1218962701,BUY             ,
231085          ,CANCELLED       ,CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC ,1218067901,BUY             ,
231085          ,CANCELLED       ,CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC ,1218621001,SEL             ,
231085          ,CANCELLED       ,DDDDDDDDDDDDDDDDDD              ,1214783201,BUY             ,
231085          ,CANCELLED       ,DDDDDDDDDDDDDDDDDD              ,1214783202,BUY             ,

I need to be able to clip the fields somehow and get rid of the spaces before the commas.

Any suggestions?