Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am looking for a way from a batch file to start excel to open a specific
xls file and then save it in tab delimited text format and then close the new ..txt file. I have a PERL script that requires the file to be in the .txt format in order to parse it. I have many files that require this operation and it would be easier to drive this process with this type of functionality. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Yes Here is what I used.
excel /read c:\temp\book6.xls i found the answer a few months aggo att the microsoft webpage http://office.microsoft.com/en-us/ex...580301033.aspx "Michael" wrote: I am looking for a way from a batch file to start excel to open a specific xls file and then save it in tab delimited text format and then close the new .txt file. I have a PERL script that requires the file to be in the .txt format in order to parse it. I have many files that require this operation and it would be easier to drive this process with this type of functionality. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Wed, 1 Aug 2007 12:30:03 -0700 from Joel
: Yes Here is what I used. excel /read c:\temp\book6.xls i found the answer a few months aggo att the microsoft webpage http://office.microsoft.com/en-us/ex...580301033.aspx Unfortunately, arrogant Microsoft won't display that page because I'm using a real browser instead of Internet Explorer. There was something about checking to see whether I have Office 2007 -- itself pretty darn arrogant. -- "The Internet is famously powered by the twin engines of bitterness and contempt." -- Nathan Rabin, /The Onion/ Stan Brown, Oak Road Systems, Tompkins County, New York, USA http://OakRoadSystems.com/ |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Stan
You could always use Excel Help on "startup switches" Gord Dibben MS Excel MVP On Sat, 4 Aug 2007 20:51:32 -0400, Stan Brown wrote: Wed, 1 Aug 2007 12:30:03 -0700 from Joel : Yes Here is what I used. excel /read c:\temp\book6.xls i found the answer a few months aggo att the microsoft webpage http://office.microsoft.com/en-us/ex...580301033.aspx Unfortunately, arrogant Microsoft won't display that page because I'm using a real browser instead of Internet Explorer. There was something about checking to see whether I have Office 2007 -- itself pretty darn arrogant. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sat, 04 Aug 2007 19:13:35 -0700 from <Gord Dibben
<gorddibbATshawDOTca: You could always use Excel Help on "startup switches" Agreed, and in fact that's how I got the information when I was looking for it a few months ago. But I am just agog at the barriers Microsoft puts up to getting information from its Web site. There seems no good reason for it. -- "The Internet is famously powered by the twin engines of bitterness and contempt." -- Nathan Rabin, /The Onion/ Stan Brown, Oak Road Systems, Tompkins County, New York, USA http://OakRoadSystems.com/ |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
"Stan Brown" wrote in message
t... Wed, 1 Aug 2007 12:30:03 -0700 from Joel : Yes Here is what I used. excel /read c:\temp\book6.xls i found the answer a few months aggo att the microsoft webpage http://office.microsoft.com/en-us/ex...580301033.aspx Unfortunately, arrogant Microsoft won't display that page because I'm using a real browser instead of Internet Explorer. There was something about checking to see whether I have Office 2007 -- itself pretty darn arrogant. I don't know which real browser you were using, but that page will display in Mozilla's Firefox. -- David Biddulph Rowing web pages at http://www.biddulph.org.uk/ |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sun, 5 Aug 2007 09:11:42 +0100 from <"David Biddulph" <groups [at]
biddulph.org.uk: "Stan Brown" wrote in message t... Wed, 1 Aug 2007 12:30:03 -0700 from Joel : Yes Here is what I used. excel /read c:\temp\book6.xls i found the answer a few months aggo att the microsoft webpage http://office.microsoft.com/en-us/ex...580301033.aspx Unfortunately, arrogant Microsoft won't display that page because I'm using a real browser instead of Internet Explorer. There was something about checking to see whether I have Office 2007 -- itself pretty darn arrogant. I don't know which real browser you were using, but that page will display in Mozilla's Firefox. The real browser I'm using is Mozilla. As I mentioned, it just displayed a page saying Microsoft was checking whether I have Office 2007, and stuck there. -- "The Internet is famously powered by the twin engines of bitterness and contempt." -- Nathan Rabin, /The Onion/ Stan Brown, Oak Road Systems, Tompkins County, New York, USA http://OakRoadSystems.com/ |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In , Stan Brown
spake thusly: Sun, 5 Aug 2007 09:11:42 +0100 from <"David Biddulph" <groups [at] biddulph.org.uk: "Stan Brown" wrote in message t... http://office.microsoft.com/en-us/ex...580301033.aspx Unfortunately, arrogant Microsoft won't display that page because I'm using a real browser instead of Internet Explorer. There was something about checking to see whether I have Office 2007 -- itself pretty darn arrogant. I don't know which real browser you were using, but that page will display in Mozilla's Firefox. The real browser I'm using is Mozilla. As I mentioned, it just displayed a page saying Microsoft was checking whether I have Office 2007, and stuck there. I don't have Office 2007, do use Firefox, and had zero trouble looking at that page, even when i declined cookies. No problems at all. It's a useful page. Microsoft does lots one could criticize, but this seems not to be one of them. -- dman |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Michael,
The example below is a vbScript that would open the xls file "C:\Test\RawTable.xls", save it as a csv file named "C:\Temp\RawTable.txt" and then convert the csv file to a tab delimited file with the same name, "C:\Temp\RawTable.txt" and finally close the txt file. _____________________ Const xlCSV = 6 Const xlDoNotSaveChanges = 2 Const ForReading = 1 Const ForWriting = 2 ' Open the Excel file and save a copy as a CSV file Set objExcel = CreateObject("Excel.Application") Set objWkbk = objExcel.Workbooks.Open("C:\Test\RawTable.xls") objExcel.DisplayAlerts = False objWkbk.SaveAs "C:\Temp\RawTable.txt", xlCSV objWkbk.Close xlDoNotSaveChanges objExcel.DisplayAlerts = True objExcel.Quit ' Open the CSV file and convert to a tab delimited file Set FSO = CreateObject("Scripting.FileSystemObject") Set objFile = FSO.OpenTextFile("C:\Temp\RawTable.txt", ForReading) strContents = objFile.ReadAll objFile.Close strContents = Replace(strContents, ",", vbTab) Set objFile = FSO.OpenTextFile("C:\Temp\RawTable.txt", ForWriting) objFile.Write StrContents objFile.Close ______________________ Steve Yandl "Michael" wrote in message ... I am looking for a way from a batch file to start excel to open a specific xls file and then save it in tab delimited text format and then close the new .txt file. I have a PERL script that requires the file to be in the .txt format in order to parse it. I have many files that require this operation and it would be easier to drive this process with this type of functionality. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What are the possible command-line arguments in Excel? | Excel Discussion (Misc queries) | |||
command line Excel Script | Excel Discussion (Misc queries) | |||
What is the command-line print switch in Excel? | Excel Discussion (Misc queries) | |||
How do i convert excel to csv in command line? ( not save as) | Excel Discussion (Misc queries) | |||
Load DBF file into Excel on command line? | Excel Discussion (Misc queries) |