- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- append the output to a .csv format
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2011 07:12 PM
тАО05-19-2011 07:12 PM
I got stuck while appending the output of command in .csv format at a aprticular column in my .csv file.
Actually i need to create a report for that i have already created the shell script and its output is coming in number suppose "32" and i have to put this number in a excel sheet to a particular location.
Pls help me.
Reagrds,
Shikhar Verma
Solved! Go to Solution.
- Tags:
- csv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2011 07:27 PM
тАО05-19-2011 07:27 PM
Re: append the output to a .csv format
You first. We non-psychics can't see any of
your data, and some of us can't guess what
you wish to do.
What do you have now?
What would you like to get?
Actual examples would probably be more useful
than vague descriptions.
Where are you trying to do this?
uname -a
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2011 07:38 PM
тАО05-19-2011 07:38 PM
Re: append the output to a .csv format
I am doing it on HP-UX server. My current script is giving me the output which i need to put it in a particular column of excel sheet.
./myscript this script is giving me some o/p
and i wanted to put this o/p in my report file, which is excel file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2011 07:45 PM
тАО05-19-2011 07:45 PM
Re: append the output to a .csv format
My query is that ---
is it possible to redirect the o/p of any shell script to a excel sheet to a particular couln or row?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2011 07:54 PM
тАО05-19-2011 07:54 PM
Re: append the output to a .csv format
15-dec-2008 15-dec-2009
16-dec-2008 16-dec-2009
say my first excel column is:
column1 column2 column3
server1
server2
I want output as below:
column1 | column2 | column3
server1 | 15-dec-2008 | 15-dec-2009
server2 | 16-dec-2008 | 16-dec-2009
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2011 08:25 PM
тАО05-19-2011 08:25 PM
Solutionyou are getting closer to a proper explanation.
IF this exactly describes the problem you can solve it like so:
$ cat > text.txt
15-dec-2008 15-dec-2009
16-dec-2008 16-dec-2009
$ cat > excel.csv
column1 column2 column3
server1
server2
$ awk 'BEGIN { print } 1' text.txt | paste -d' ' excel.csv - | sed 's/ / | /g'
column1 | column2 | column3 |
server1 | 15-dec-2008 | 15-dec-2009
server2 | 16-dec-2008 | 16-dec-2009
First we use AWK to feed a pipe with a blank line and the contents of the text file.
That gets patsted with the excel file using a space, not the default tab, as seperator.
Finally replace each space with a spaced-bar/pipe
I doubt that this will solve the problem though.
You really want to know more about the data. Like whether you know for sure each line is in the right order.
Maybe there is a 'key' column perhaps 'system same' and we should use JOIN, not PASTE
Maybe you should really take a huge step back and revisit how the data comes to be.
Whether the column headers are meaningful and that meanig can be used.
Whether column headers are hardcoded or should/could be generated.
Whether the lines just have order, or have a 'tag'/'key'.
Good luck!
Hein