LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-15-2012, 03:42 AM   #16
bama90
LQ Newbie
 
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled

I thinks probably it would be good if you posted an example-file and explain your problem in more detail.
 
Old 11-15-2012, 02:52 PM   #17
graphicsmanx1
Member
 
Registered: Oct 2012
Posts: 81

Original Poster
Rep: Reputation: Disabled
actually this doesnt work too bad. I was playing around and it worked for A code I made for fun:

Code:
echo $variable,$variable,$variable >> file.csv
each column was printed to what I set for the variable. I made a script to log what I ran through some other scripts I learned from here:

Code:
name=$(basename $target)
day=$(date +%Y-%m-%d)
point=$(date +%H:%M:%S)
echo $name,$day,$point >> results.csv
 
Old 11-15-2012, 07:03 PM   #18
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 637

Rep: Reputation: 140Reputation: 140
file.csv is actually a TEXT file containing comma separated values. IT DOESN'T STORE DATA ABOUT THE DESTINATION FILE'S ROWS AND COLUMNS.

Microsoft and indeed most other spreadsheet programs(like open office and libre office) provide a way to open the data so that it can be used like a spreadsheet.

OK
 
Old 11-16-2012, 03:48 PM   #19
graphicsmanx1
Member
 
Registered: Oct 2012
Posts: 81

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AnanthaP View Post
file.csv is actually a TEXT file containing comma separated values. IT DOESN'T STORE DATA ABOUT THE DESTINATION FILE'S ROWS AND COLUMNS.

Microsoft and indeed most other spreadsheet programs(like open office and libre office) provide a way to open the data so that it can be used like a spreadsheet.

OK
yes thanks I am aware of that. All Im stating is that this is something that works for csv
 
Old 11-19-2012, 04:09 AM   #20
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 637

Rep: Reputation: 140Reputation: 140
The original discussion was about excel and whether csv files can have row and column ids embedded in them.
Quote:
I wanted to know if I could print results to certain columns and rows I assign.
This was your original problem.

I am concerned that that this default opening of csv files by msexcel has led to a general dumbing down of knowledge about file formats so that people dont know that CSV is a plain human readable format and we can use many command line utilities that predate msexcel (like awk and sed) to to open and interpret the contents.

Even in your redirection example (post #17 in this thread), the destination row and column numbers cant be stored in the csv file.

If you open your spreadsheet and position the cursor in any arbitrary cell say cell "b25", say and import the data by pasting, it will be imported into cell b25 onwards. You are not assigning the desired cell in the csv file.

OK

Last edited by AnanthaP; 11-19-2012 at 04:13 AM.
 
Old 11-19-2012, 08:17 AM   #21
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
graphicsmanx1, did you consider AnanthaP's suggestion to look for perl modules that are capable of working with Excel's proprietary format or my suggestion to use LibreOffice's facilities to do the same? Or are you happy to use the CSV route?
 
Old 11-19-2012, 08:52 AM   #22
graphicsmanx1
Member
 
Registered: Oct 2012
Posts: 81

Original Poster
Rep: Reputation: Disabled
I like the CSV but I will learn the proper way to do it. Many good ideas
 
Old 11-20-2012, 02:49 AM   #23
grizzlysmit
LQ Newbie
 
Registered: Sep 2010
Posts: 5

Rep: Reputation: 0
Perl can do this as can Python try xlwt if you go the python root not sure in perl but CPAN will have it
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading one EXCEL(.xls) file and writing to other EXCEL(.xls) file vijay mishra General 6 04-23-2012 07:53 PM
How to copy Arabic data from excel fiel to another excel file in PERL? David the H. Linux - Newbie 0 04-23-2012 09:24 AM
Convert from XML in excel format to Excel XLS file CPAN module Perseus Programming 9 10-14-2011 12:39 PM
How to echo results of variable BabaKali Linux - Newbie 7 11-10-2004 12:47 PM


All times are GMT -5. The time now is 08:13 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration