• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Sending Email from a Script - Needing Tab Delimited Formatting

Scarpozzi

Lifer
I've got a report that I've created through some bash scripts. Basically, I'm using a bash script to go out and grab a bunch of data. The output of the script is neat and throws everythign into tab delimited format with a few rows acting as the header.

My problems is when I send this in an Email to myself from the script, everything gets scrunched up and it's difficult to read. I used awk to throw a new line character at the end of every line so the Email is at least somewhat organized, but it still doesn't maintain the tab delimited format.

Should I look at doing this with Perl instead?
 
The problem is that tab length is by no means a constant anywhere (in fact, your email program is most likely ignoring the tabs all together.) In fact, there is a strong possibility that your email system won't recognize two spaces next to each other.

The best solution I can think of is putting the data into an html table, somehow, and then sending that as most email systems read html.

The next best solution would outputting to a text file and then sending that file as an attachment rather than putting th information in the body of the email. But even then, like I said earlier tab width isn't set to a universal constant. There is a good chance that you would have to futz with the output to make things look pretty.
 
The problem is that tab length is by no means a constant anywhere (in fact, your email program is most likely ignoring the tabs all together.) In fact, there is a strong possibility that your email system won't recognize two spaces next to each other.

The best solution I can think of is putting the data into an html table, somehow, and then sending that as most email systems read html.

The next best solution would outputting to a text file and then sending that file as an attachment rather than putting th information in the body of the email. But even then, like I said earlier tab width isn't set to a universal constant. There is a good chance that you would have to futz with the output to make things look pretty.

I ended up researching after I posted and came to the same assumption. I exported the processing file to txt format and dropped it in as an attachment. I hadn't thought of the html formatting trick...I'm a little 'old school' and forget that Email is more than just text. I'll have to remember that because I'm sure I'll need to do something like this in the future.

Thanks.
 
The problem is that tab length is by no means a constant anywhere (in fact, your email program is most likely ignoring the tabs all together.) In fact, there is a strong possibility that your email system won't recognize two spaces next to each other.

The standard program "expand" solves the issue of inconsistent definitions of tab. IIRC, mail programs (including Outlook) will respect multiple consecutive spaces as long as the email is formatted as text, not HTML.
 
Back
Top