Macro to convert CSV to PRN

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know I am not the only one to need this so I was hoping someone could help.

The search engines keep coming up with ABC software that I don't plan on
buying and I can't find any shareware.

I have dozens of CSV files that I need converted to PRN. Does anyone have a
Macro that will do this? I wish I had a batch file to do a list of filenames
but that is asking too much. Thnks.
 
do you actually want to change them from comma delimited to fixed column?

Or do you just want to rename them to have a .prn extension?

If fixed column, would they all have the same format?

Or do you just want to load them into excel and then save them as PRN -
however they come out.

for a list of files

Sub listfiles()
Dim rw as Long, sPath as String
Dim sName as String
rw = 2
sPath = "C:\MyDirectory\MySubfolder\"
sName = dir(spath & "*.csv")
do while sName <> ""
cells(rw,1) = sName
sName = dir
rw = rw + 1
Loop
End sub
 
I guess I thought the way our company used PRN data files was standard. Ours
has a special header with numbers telling applications how many variables
there are, how many lines of header there is, and how many samples there are.


I didn't realize a normal PRN was just a CSV with normalized columns or
something.

Excel does put a bunch of extra commas when I tried to make my own macro. I
have to make sure that I delete any blank cells that may have had data in it
at one time to prevent the commas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top