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%
Not able to create tables by using batch cmd
Moderator: DosItHelp
-
- Expert
- Posts: 1167
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Not able to create tables by using batch cmd
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 "".
Also, you need to escape the quotes in image_start and image_end by doubling them up, like "".
-
- Expert
- Posts: 1167
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Not able to create tables by using batch cmd
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
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
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
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.
-
- Expert
- Posts: 1167
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Not able to create tables by using batch cmd
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.