Find the answer to your Linux question:
Results 1 to 7 of 7
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Question Looking for an intro on csv to html


    Are there any good places to dive into getting a csv file to an html based table for email purposes?

    I have a 4 column csv file, separated by commas, that I want to make more presentable for sending out via email.

    I've read through some pages that use the while command to read through the file I have, but I don't really understand the placement of the "tr" and "td" variables.

    Thanks.

    ex of my csv is like such

    server, kernel, ip address, uptime

  2. #2
    Quote Originally Posted by agentguerry View Post
    Are there any good places to dive into getting a csv file to an html based table for email purposes?

    I have a 4 column csv file, separated by commas, that I want to make more presentable for sending out via email.

    I've read through some pages that use the while command to read through the file I have, but I don't really understand the placement of the "tr" and "td" variables.

    Thanks.

    ex of my csv is like such

    server, kernel, ip address, uptime
    if you dont know basics of html and cant understand the boatload of docs for it what do you think we'll be able to tell you? tr starts a row. td is an item in that row. open close them like you would any html tag. start a table with table end with /table. simple. make your script do that.

  3. #3
    I understand what TR and TD mean...

    I'm looking for any best practices of what command works best to grab the data and place it within rows and fields.

    I am currently reading through other posts and documents but I thought I would post here to gather any information that could be useful, while I am researching. Your answer was not that.

  4. $spacer_open
    $spacer_close
  5. #4
    Quote Originally Posted by agentguerry View Post
    I understand what TR and TD mean...
    and you said "i don't really understand the placement of the tr and td variables". makes zero sense. if you know what they do why cant you understand where they go? the row you describe has 4 elements right? if you know that td is for an element, and tr is for a row, and how to open/close a tag what dont you understand? you cant understand it and NOT understand it at the same time.

    since it looks like your trolling for someone to write you a script, i'll give you one piece thats useless without a script, so you can show your own effort that you havent so far
    <tr><td>server</td><td>kernel</td><td>ip address</td><td>uptime</td></tr>

    see????? you claim to understand what they do but couldnt get that?
    I'm looking for any best practices of what command works best to grab the data and place it within rows and fields. I am currently reading through other posts and documents but I thought I would post here to gather any information that could be useful, while I am researching. Your answer was not that.
    there is no 'best" you write your own scripts. best is what works for you.

  6. #5
    If I wanted someone to give me a script I would have asked right out. Is your sarcasm needed? Nope. You may as well just stop posting on my thread. I assume you will though b/c you will want the last word.

  7. #6
    Quote Originally Posted by agentguerry View Post
    If I wanted someone to give me a script I would have asked right out.
    typically not since folks who want things done for them use this tactic. asking flat out gets folks little.
    Is your sarcasm needed? Nope. You may as well just stop posting on my thread. I assume you will though b/c you will want the last word.
    whatever. you said you understood what something did but not how to use it. you realize those two things are mutually exclusive, right? if you understood what a tr/td/table tag did youd understand how to use them. or you could have looked up one of the gazillion basic www guides that tell you. but no. you didnt.

    the 'command to use" isn't one but a script. write it. and your entire project is useless anyway, since the sender can disable html emails and your entire report will look like junk. but you could just put the html to a file on a webserver, but that'd need a script too.

  8. #7
    Linux Guru
    Join Date
    Dec 2013
    Posts
    2,747
    -->
    agentguerry, at the very least you have to learn to search before posting.
    i agree with habit that it looks a lot like you haven't even done the most basic research to solve your problem: https://www.startpage.com/do/dsearch...sv+create+html
    you might not agree with their tone, but in essence you will get the same answer on any forum:
    show us what you got, show us some effort, then we will help you.
    because too many people do indeed use this very tactic to get some bleeding heart to write their script for them.
    which btw isn't even possible because none but you have seen the source csv file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •