RE: Using Mutiple Sheets in excel in shell script

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: Mac OS X Security - Not Quite as Strong as you Thought
    ... What needs to be fixed is the installer itself, ... Eventually you could trace it back to one of the fundamental Unix libs. ... UNIX won't prevent an idiot from damaging his own system, but it sure won't run a shell script that was downloaded from another system. ... The userid won't match for one thing and another is that if it were emailed, the x bit is set off, which means the user would have to chmod +x file to get it to work. ...
    (comp.sys.mac.advocacy)
  • Re: Google Earth for Linux released
    ... Have fun! ... Well the piece of crap don't run on my machine. ... For this GE file it would say 'shell script', so you'd know to run it ... I have run every flavor of Unix, QNX, zenix, Irix, several Linux ...
    (alt.os.linux.suse)
  • Re: how to tell if a file is inary file or ascii file?
    ... >>Is there a way to find if a file is a binary executable file or an ASCII ... > may assume it's a Bourne shell script. ... a unix shell, but if the file is a shell script and not binary ...
    (comp.unix.programmer)
  • Re: "RESTful Web Services"
    ... so Unix should make that easy to automate. ... Lisp, lambda calculus, and AI so much as it is the notion of regular ... experience - the "compilation phase" comes when you save a shell ... save a Perl script which writes a shell script for you to ...
    (comp.lang.ruby)