在cmd中创建长文本文件

时间:2021-05-01 06:26:13

Simple question i need to create reset.css file with batch file. I know how to make short-text files but when trying to put in a long text it doesn't work.

简单的问题我需要使用批处理文件创建reset.css文件。我知道如何制作短文本文件但是当试图输入长文本时它不起作用。

Here's the text

这是文字

    html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

I just need some command so i can paste this text to batch file so it can save it

我只需要一些命令,这样我就可以将这个文本粘贴到批处理文件中,这样就可以保存它

2 个解决方案

#1


0  

You need to escape special characters and maybe use quotes! :)

你需要逃避特殊字符,也许使用引号! :)

here's what I got using TextZipper...

这是我使用TextZipper得到的...

@echo off
echo Textzipper is writing the files...
echo     html, body, div, span, applet, object, iframe, >> "asd.txt"
echo h1, h2, h3, h4, h5, h6, p, blockquote, pre, >> "asd.txt"
echo a, abbr, acronym, address, big, cite, code, >> "asd.txt"
echo del, dfn, em, img, ins, kbd, q, s, samp, >> "asd.txt"
echo small, strike, strong, sub, sup, tt, var, >> "asd.txt"
echo b, u, i, center, >> "asd.txt"
echo dl, dt, dd, ol, ul, li, >> "asd.txt"
echo fieldset, form, label, legend, >> "asd.txt"
echo table, caption, tbody, tfoot, thead, tr, th, td, >> "asd.txt"
echo article, aside, canvas, details, embed,  >> "asd.txt"
echo figure, figcaption, footer, header, hgroup,  >> "asd.txt"
echo menu, nav, output, ruby, section, summary, >> "asd.txt"
echo time, mark, audio, video { >> "asd.txt"
echo     margin: 0; >> "asd.txt"
echo     padding: 0; >> "asd.txt"
echo     border: 0; >> "asd.txt"
echo     font-size: 100%%; >> "asd.txt"
echo     font: inherit; >> "asd.txt"
echo     vertical-align: baseline; >> "asd.txt"
echo } >> "asd.txt"
echo /* HTML5 display-role reset for older browsers */ >> "asd.txt"
echo article, aside, details, figcaption, figure,  >> "asd.txt"
echo footer, header, hgroup, menu, nav, section { >> "asd.txt"
echo     display: block; >> "asd.txt"
echo } >> "asd.txt"
echo body { >> "asd.txt"
echo     line-height: 1; >> "asd.txt"
echo } >> "asd.txt"
echo ol, ul { >> "asd.txt"
echo     list-style: none; >> "asd.txt"
echo } >> "asd.txt"
echo blockquote, q { >> "asd.txt"
echo     quotes: none; >> "asd.txt"
echo } >> "asd.txt"
echo blockquote:before, blockquote:after, >> "asd.txt"
echo q:before, q:after { >> "asd.txt"
echo     content: ''; >> "asd.txt"
echo     content: none; >> "asd.txt"
echo } >> "asd.txt"
echo table { >> "asd.txt"
echo     border-collapse: collapse; >> "asd.txt"
echo     border-spacing: 0; >> "asd.txt"
echo } >> "asd.txt"
echo Done.

#2


1  

This is the same code that was in the other answer, but changed to allow easier editing and the correct filename.

这与另一个答案中的代码相同,但更改为允许更容易编辑和正确的文件名。

@echo off
set "file=reset.css"
>>%file% echo     html, body, div, span, applet, object, iframe,
>>%file% echo h1, h2, h3, h4, h5, h6, p, blockquote, pre,
>>%file% echo a, abbr, acronym, address, big, cite, code,
>>%file% echo del, dfn, em, img, ins, kbd, q, s, samp,
>>%file% echo small, strike, strong, sub, sup, tt, var,
>>%file% echo b, u, i, center,
>>%file% echo dl, dt, dd, ol, ul, li,
>>%file% echo fieldset, form, label, legend,
>>%file% echo table, caption, tbody, tfoot, thead, tr, th, td,
>>%file% echo article, aside, canvas, details, embed, 
>>%file% echo figure, figcaption, footer, header, hgroup, 
>>%file% echo menu, nav, output, ruby, section, summary,
>>%file% echo time, mark, audio, video {
>>%file% echo     margin: 0;
>>%file% echo     padding: 0;
>>%file% echo     border: 0;
>>%file% echo     font-size: 100%%;
>>%file% echo     font: inherit;
>>%file% echo     vertical-align: baseline;
>>%file% echo }
>>%file% echo /* HTML5 display-role reset for older browsers */
>>%file% echo article, aside, details, figcaption, figure, 
>>%file% echo footer, header, hgroup, menu, nav, section {
>>%file% echo     display: block;
>>%file% echo }
>>%file% echo body {
>>%file% echo     line-height: 1;
>>%file% echo }
>>%file% echo ol, ul {
>>%file% echo     list-style: none;
>>%file% echo }
>>%file% echo blockquote, q {
>>%file% echo     quotes: none;
>>%file% echo }
>>%file% echo blockquote:before, blockquote:after,
>>%file% echo q:before, q:after {
>>%file% echo     content: '';
>>%file% echo     content: none;
>>%file% echo }
>>%file% echo table {
>>%file% echo     border-collapse: collapse;
>>%file% echo     border-spacing: 0;
>>%file% echo }

#1


0  

You need to escape special characters and maybe use quotes! :)

你需要逃避特殊字符,也许使用引号! :)

here's what I got using TextZipper...

这是我使用TextZipper得到的...

@echo off
echo Textzipper is writing the files...
echo     html, body, div, span, applet, object, iframe, >> "asd.txt"
echo h1, h2, h3, h4, h5, h6, p, blockquote, pre, >> "asd.txt"
echo a, abbr, acronym, address, big, cite, code, >> "asd.txt"
echo del, dfn, em, img, ins, kbd, q, s, samp, >> "asd.txt"
echo small, strike, strong, sub, sup, tt, var, >> "asd.txt"
echo b, u, i, center, >> "asd.txt"
echo dl, dt, dd, ol, ul, li, >> "asd.txt"
echo fieldset, form, label, legend, >> "asd.txt"
echo table, caption, tbody, tfoot, thead, tr, th, td, >> "asd.txt"
echo article, aside, canvas, details, embed,  >> "asd.txt"
echo figure, figcaption, footer, header, hgroup,  >> "asd.txt"
echo menu, nav, output, ruby, section, summary, >> "asd.txt"
echo time, mark, audio, video { >> "asd.txt"
echo     margin: 0; >> "asd.txt"
echo     padding: 0; >> "asd.txt"
echo     border: 0; >> "asd.txt"
echo     font-size: 100%%; >> "asd.txt"
echo     font: inherit; >> "asd.txt"
echo     vertical-align: baseline; >> "asd.txt"
echo } >> "asd.txt"
echo /* HTML5 display-role reset for older browsers */ >> "asd.txt"
echo article, aside, details, figcaption, figure,  >> "asd.txt"
echo footer, header, hgroup, menu, nav, section { >> "asd.txt"
echo     display: block; >> "asd.txt"
echo } >> "asd.txt"
echo body { >> "asd.txt"
echo     line-height: 1; >> "asd.txt"
echo } >> "asd.txt"
echo ol, ul { >> "asd.txt"
echo     list-style: none; >> "asd.txt"
echo } >> "asd.txt"
echo blockquote, q { >> "asd.txt"
echo     quotes: none; >> "asd.txt"
echo } >> "asd.txt"
echo blockquote:before, blockquote:after, >> "asd.txt"
echo q:before, q:after { >> "asd.txt"
echo     content: ''; >> "asd.txt"
echo     content: none; >> "asd.txt"
echo } >> "asd.txt"
echo table { >> "asd.txt"
echo     border-collapse: collapse; >> "asd.txt"
echo     border-spacing: 0; >> "asd.txt"
echo } >> "asd.txt"
echo Done.

#2


1  

This is the same code that was in the other answer, but changed to allow easier editing and the correct filename.

这与另一个答案中的代码相同,但更改为允许更容易编辑和正确的文件名。

@echo off
set "file=reset.css"
>>%file% echo     html, body, div, span, applet, object, iframe,
>>%file% echo h1, h2, h3, h4, h5, h6, p, blockquote, pre,
>>%file% echo a, abbr, acronym, address, big, cite, code,
>>%file% echo del, dfn, em, img, ins, kbd, q, s, samp,
>>%file% echo small, strike, strong, sub, sup, tt, var,
>>%file% echo b, u, i, center,
>>%file% echo dl, dt, dd, ol, ul, li,
>>%file% echo fieldset, form, label, legend,
>>%file% echo table, caption, tbody, tfoot, thead, tr, th, td,
>>%file% echo article, aside, canvas, details, embed, 
>>%file% echo figure, figcaption, footer, header, hgroup, 
>>%file% echo menu, nav, output, ruby, section, summary,
>>%file% echo time, mark, audio, video {
>>%file% echo     margin: 0;
>>%file% echo     padding: 0;
>>%file% echo     border: 0;
>>%file% echo     font-size: 100%%;
>>%file% echo     font: inherit;
>>%file% echo     vertical-align: baseline;
>>%file% echo }
>>%file% echo /* HTML5 display-role reset for older browsers */
>>%file% echo article, aside, details, figcaption, figure, 
>>%file% echo footer, header, hgroup, menu, nav, section {
>>%file% echo     display: block;
>>%file% echo }
>>%file% echo body {
>>%file% echo     line-height: 1;
>>%file% echo }
>>%file% echo ol, ul {
>>%file% echo     list-style: none;
>>%file% echo }
>>%file% echo blockquote, q {
>>%file% echo     quotes: none;
>>%file% echo }
>>%file% echo blockquote:before, blockquote:after,
>>%file% echo q:before, q:after {
>>%file% echo     content: '';
>>%file% echo     content: none;
>>%file% echo }
>>%file% echo table {
>>%file% echo     border-collapse: collapse;
>>%file% echo     border-spacing: 0;
>>%file% echo }