Page 1 of 1

Not able to create tables by using batch cmd

Posted: 09 Nov 2014 00:18
by giritime
I want to add gif files into a TABLE (HTML file) by using batch command, I am facing problem with below lines

set "table_start=^<table border='1'>"
set "table_one=^<tr^>^<th^>^Name^</th^>^<th^>^Remarks^</th^>^</tr^>"


when i edit the html file in notepad i don't see tags for table border and row one.
Below is the complete code, can somebody help me on this?

@echo off
setlocal

set "file_start=^<title^>^HTML Table Header GIRI^</title^>"
set "table_start=^<table border='1'>"
set "row_one=^<tr^>^<th^>^Name^</th^>^<th^>^Remarks^</th^>^</tr^>"
set "image_start=^<tr^>^<th^>^<IMG SRC=""
set ^"image_end="^>^</th^>^<th^>^Remarks^</th^>^</tr^>"
set "table_end=^</table^>"
set "file_end=^</BODY^>^</HTML^>"
set "file_name=Index.html"


>"%file_name%" ( echo %USERNAME% %DATE% %TIME%
echo %file_start%
for %%I in (*.gif) do echo %image_start%%%~fI%image_end%

echo %file_end%
)

start %file_name%

Re: Not able to create tables by using batch cmd

Posted: 09 Nov 2014 07:59
by ShadowThief
It would probably help if you echoed %table_start% and %row_one% somewhere into the file.

Also, you need to escape the quotes in image_start and image_end by doubling them up, like "".

Re: Not able to create tables by using batch cmd

Posted: 09 Nov 2014 08:25
by ShadowThief
And since people here care about this, cross-posted on StackOverflow at http://stackoverflow.com/questions/2682 ... -batch-cmd (although for what it's worth, it was posted here first).

Re: Not able to create tables by using batch cmd

Posted: 09 Nov 2014 08:30
by giritime
ShadowThief wrote:And since people here care about this, cross-posted on StackOverflow at http://stackoverflow.com/questions/2682 ... -batch-cmd (although for what it's worth, it was posted here first).


I was just trying my luck.

Re: Not able to create tables by using batch cmd

Posted: 09 Nov 2014 08:36
by giritime
Sorry i didn't get the suggestion you suggested can you please elaborate in detail?

Re: Not able to create tables by using batch cmd

Posted: 09 Nov 2014 11:58
by Squashman
giritime wrote:Sorry i didn't get the suggestion you suggested can you please elaborate in detail?

You never output those variables to any file.

Re: Not able to create tables by using batch cmd

Posted: 09 Nov 2014 12:19
by ShadowThief
giritime wrote:Sorry i didn't get the suggestion you suggested can you please elaborate in detail?

That thing that you marked as the solution on StackOverflow? Do that.

Signed,
The guy who goes by SomethingDark on the other site.