If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > xls to csv using bat file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-14-04, 17:14
alexis200487 alexis200487 is offline
Registered User
 
Join Date: Feb 2004
Location: New York
Posts: 45
xls to csv using bat file

Hello,
I want to gather a small portion of an Excel spreadsheet and write the data to a comma delimited file for import into another program with SQLLdr + I need to delete a first row...

So far, I have a bat. file that grab an xls file from one directory , copy that file to another as csv format..

But I can not find a way to remove a first row in already formated file.

I was trying to use this in my bat file but it did not worked the way I want it. /p250 /1 2-150 by
It just opend a file for me to delete...

Suggestions?

Thanky you.

A.
Reply With Quote
  #2 (permalink)  
Old 04-21-04, 01:27
jnmurphy jnmurphy is offline
Registered User
 
Join Date: Apr 2004
Location: Bothell, WA
Posts: 4
why not build a macro

I'm no whiz at batch files, but what you're trying to do sounds like it should be easy to do as a macro. If you want it to be configurable, or save the file in a specific location you could do that in the VBA code, but if you just want to grab the same set of cells, delete the top row and save it as a csv file then try this code (you can modify the file location to fit your needs):

Sub csvsaver()

Rows("1:1").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
ChDir "C:\Documents and Settings\Default\Desktop"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Default\Desktop\Book1.csv", FileFormat:=xlCSV, _
CreateBackup:=False

End Sub
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On