Need to convert datafeed to html using script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to convert datafeed to html using script
# 1  
Old 06-25-2012
Error Need to convert datafeed to html using script

Hi All,

I am having datafeed content in CSV format like below. Any help to create a script. I need read the CSV file on loop and update it in html format for web publishing



Quote:
keyword1 Description Image1 Price1 buyurl


I want to chage the data using my token based template and save the file out to new csv file



Quote:
<h2>%KEYWORD%</h2><p>Price:%PRICE%</p><p><a href="http://www.sit-id.com/"><img src="%IMAGE%"></a></p><p><a href="%BUYURL%"><img src="buynow.jpg"></a></p><p><strong>Product Description</strong></p><p>%DESCRIPTION%</p><a href="%BUYURL%"> read more..
# 2  
Old 06-25-2012
I see a conspicuous lack of commas in your comma separated values. I'm assuming it's just an ordinary flatfile?

Code:
while read KEYWORD DESC IMAGE PRICE BUYURL
do
cat <<EOF
<h2>${KEYWORD}</h2><p>Price:${PRICE}</p><p><a href="http://www.sit-id.com/"><img src="${IMAGE}"></a></p><p><a href="${BUYURL}"><img src="buynow.jpg"></a></p><p><strong>Product Description</strong></p><p>${DESC}</p><a href="${BUYURL}"> read more..
EOF
done > output

# 3  
Old 06-25-2012
Thanks for your replay. Just to update I have datafeed in csv format. I will be having around 15k records. I need to do loop for all 15k row and save the output to another csv file



Quote:
col1 col2 col3 col4 col5
Keyword Desc Image Price Buyurl


# 4  
Old 06-25-2012
You want your HTML in a CSV file? what? Smilie

Again, that doesn't look like CSV. CSV is comma-separated. It looks more like an ordinary flatfile.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to convert my /bin/sh script with cgi and html to run it on browser!??

Hello, I want to run this script on my CentOS 6 via browser : ________________________________________________________________________________________________ #!/bin/sh echo Username? read MY_NAME echo Provisional file name? read MY_FILE echo File NAME you want to save? read MY_FILE2... (16 Replies)
Discussion started by: juta2020
16 Replies

2. Shell Programming and Scripting

Convert shell script output txt file to html table

My concnern related to the post -Convert shell script output txt file to html table, in this how to print the heading as color. awk 'BEGIN{print "<table>"} {print "<tr>";for(i=1;i<=NF;i++)print "<td>" $i"</td>";print "</tr>"} END{print "</table>"}' <filename> (8 Replies)
Discussion started by: sarajobmai
8 Replies

3. Shell Programming and Scripting

Using CSH and need to convert html to PDF

Hi, I am currently using the below code and it throws an error saying badly placed ()'s. I am not sure if this right way to convert html to PDF, please help..I am using C-shell script system ("../html2doc pdf 1000 portrait html$prnfile.html $prnfile.pdf ") print "Content-type:application/pdf... (7 Replies)
Discussion started by: lakers646
7 Replies

4. Shell Programming and Scripting

Script to convert csv file to html with good visibility

Hi, I have Below script which converts csv file to html succesfully.but the visiblity is simple in black n white. I want to have better visibilty of each columns in different colours(like green).As it is a Database report suppose some tablespace available space is less than 20% then it should... (7 Replies)
Discussion started by: sv0081493
7 Replies

5. Shell Programming and Scripting

Script to convert CSV file to HTML

Hi, I have made a a script which creates a csv file as daily database report However i want to covert that csv file to html because csv file does not have a good visibilty. So it is possible to have such csv to html coversion script. Your prompt help much appreciated. Thanks in advance (4 Replies)
Discussion started by: sv0081493
4 Replies

6. Shell Programming and Scripting

Convert shell script output txt file to html table

Hi, I have script which generates the output as below: Jobname Date Time Status abc 12/9/11 17:00 Completed xyz 13/9/11 21:00 Running I have the output as a text file. I need to convert it into a HTML Table and sent it thru email ... (6 Replies)
Discussion started by: a12ka4
6 Replies

7. Shell Programming and Scripting

Awk script to convert csv to html

Hi Written some script to convert csv to html but could not add table headers.Below are the errors iam getting ./csv2html | more + awk -v border=1 -v width=10 -v bgcolor=black -v fgcolor=white BEGIN { printf("<table border=\"%d\" bordercolor=\"%s\" width=\"%d\"... (2 Replies)
Discussion started by: zeebala1981
2 Replies

8. UNIX for Dummies Questions & Answers

convert csv to html file

Hi All, I am new to this forum,not sure where to post this query...so posted here Kindly need any of your help on the below ------------ I am using shell scripting and trying to convert a csv file to html file... example.csv --------------- Name Country Age Sex Andy India 25 ... (4 Replies)
Discussion started by: sumithra
4 Replies

9. Shell Programming and Scripting

Script to Convert HTML to MIME mail -- HELP!

Hi: I have writed a script that read a HTML file and convert this in a multipart mime fail to send in a mail. But the result isn't interpreted lika a mime file!! Somebody can see the error??? --------------------------- #! /bin/bash SB=$1 IF=$2 OF=$3 rm -f $OF.b64 ... (7 Replies)
Discussion started by: sushisan
7 Replies

10. Shell Programming and Scripting

Need help to convert Flat file to HTML

Hello I need help to convert flat file data to HTML Table format. I am generating everyday Flat file and want to convert into HTML Table format. The format of my file is: version host Total YRS NO APPS PSD 10 Sun 30 2 4 6 7 and flat... (11 Replies)
Discussion started by: getdpg
11 Replies
Login or Register to Ask a Question