Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Using Mutiple Sheets in excel in shell script

Hi,
I'm trying to export some data into .csv format from a shell script. I need
to export data into deifferent sheets based on the criteria.

Any help on how to do this will eb greatly appreciated

Thanks,
Phani
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Using Mutiple Sheets in excel in shell script

Sub WriteCSV()

Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const MyPath = "C:\temp\"
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0


Set fswrite = CreateObject("Scripting.FileSystemObject")

WriteFileName = "text.csv"


'open files

WritePathName = MyPath + WriteFileName
fswrite.CreateTextFile WritePathName
Set fwrite = fswrite.GetFile(WritePathName)
Set tswrite = fwrite.OpenAsTextStream(ForWriting, TristateUseDefault)

LastRow = Cells(Rows.Count, "A").End(xlUp).Row
LastCol = Cells(1, Columns.Count).End(xlToLeft).Column

For RowCount = 1 To LastRow

OutputLine = ""
For ColumnCount = 1 To LastCol

If Len(OutputLine) 0 Then OutputLine = OutputLine & ","
OutputLine = OutputLine & CStr(Cells(RowCount, ColumnCount))

Next ColumnCount

tswrite.WriteLine OutputLine


Next RowCount


tswrite.Close

End Sub


"Phanidhar" wrote:

Hi,
I'm trying to export some data into .csv format from a shell script. I need
to export data into deifferent sheets based on the criteria.

Any help on how to do this will eb greatly appreciated

Thanks,
Phani

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Using Mutiple Sheets in excel in shell script

Thanks Joel for your response. But I'm looking for a solution that can be
done from a unix shell script.

"Joel" wrote:

Sub WriteCSV()

Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const MyPath = "C:\temp\"
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0


Set fswrite = CreateObject("Scripting.FileSystemObject")

WriteFileName = "text.csv"


'open files

WritePathName = MyPath + WriteFileName
fswrite.CreateTextFile WritePathName
Set fwrite = fswrite.GetFile(WritePathName)
Set tswrite = fwrite.OpenAsTextStream(ForWriting, TristateUseDefault)

LastRow = Cells(Rows.Count, "A").End(xlUp).Row
LastCol = Cells(1, Columns.Count).End(xlToLeft).Column

For RowCount = 1 To LastRow

OutputLine = ""
For ColumnCount = 1 To LastCol

If Len(OutputLine) 0 Then OutputLine = OutputLine & ","
OutputLine = OutputLine & CStr(Cells(RowCount, ColumnCount))

Next ColumnCount

tswrite.WriteLine OutputLine


Next RowCount


tswrite.Close

End Sub


"Phanidhar" wrote:

Hi,
I'm trying to export some data into .csv format from a shell script. I need
to export data into deifferent sheets based on the criteria.

Any help on how to do this will eb greatly appreciated

Thanks,
Phani

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Using Mutiple Sheets in excel in shell script

This is a Excel discussion group mainly for Windows environment. I don't
know whatt tool un have on your machine. the program is a piece of cake to
write in C Language and hardewr in a shell script. I don't havve access to a
unix machine and my shell programming is a little rusty.

The code below can be compiled on any basic compiler and run on unix if you
have a compiler. the patth names will have to change to be compattiabble
with unix.

"Phanidhar" wrote:

Thanks Joel for your response. But I'm looking for a solution that can be
done from a unix shell script.

"Joel" wrote:

Sub WriteCSV()

Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const MyPath = "C:\temp\"
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0


Set fswrite = CreateObject("Scripting.FileSystemObject")

WriteFileName = "text.csv"


'open files

WritePathName = MyPath + WriteFileName
fswrite.CreateTextFile WritePathName
Set fwrite = fswrite.GetFile(WritePathName)
Set tswrite = fwrite.OpenAsTextStream(ForWriting, TristateUseDefault)

LastRow = Cells(Rows.Count, "A").End(xlUp).Row
LastCol = Cells(1, Columns.Count).End(xlToLeft).Column

For RowCount = 1 To LastRow

OutputLine = ""
For ColumnCount = 1 To LastCol

If Len(OutputLine) 0 Then OutputLine = OutputLine & ","
OutputLine = OutputLine & CStr(Cells(RowCount, ColumnCount))

Next ColumnCount

tswrite.WriteLine OutputLine


Next RowCount


tswrite.Close

End Sub


"Phanidhar" wrote:

Hi,
I'm trying to export some data into .csv format from a shell script. I need
to export data into deifferent sheets based on the criteria.

Any help on how to do this will eb greatly appreciated

Thanks,
Phani

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Using Mutiple Sheets in excel in shell script

Are you on a Mac?

Do can you add Perl Modules to your machine?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Using Mutiple Sheets in excel in shell script

Yeah,

You need to say something about the type of shell script you want to
use and what operating system you're using.

You could use VBScript, Perl, Perl/AppleScript (say on the Mac).

No one has time to create all possible solutions for you, all of which
you'd probably ignore anyway.

Try Again.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Summing common cell over mutiple sheets within a file? Bill Excel Worksheet Functions 5 October 12th 09 10:09 PM
Running mutiple excel sheets on mutiple computers Lost Excel Discussion (Misc queries) 3 January 16th 09 12:32 AM
Sumif across mutiple sheets jwang036 Excel Worksheet Functions 3 May 29th 08 07:26 PM
Mutiple Spread Sheets ABA Excel Worksheet Functions 0 May 13th 08 10:10 PM
Search Mutiple Excel Sheets. Ben Jimenez Excel Programming 0 August 8th 03 07:13 PM


All times are GMT +1. The time now is 01:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"