Computing.Net > Forums > Disk Operating System > Inserting String into document

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Inserting String into document

Reply to Message Icon

Name: Tommyboy
Date: November 19, 2002 at 11:37:20 Pacific
OS: 2000
CPU/Ram: 8Gb
Comment:

I have an application that is browser based and updates nightly an index.html page. I have a line of code that I need insterted at the top of the page after it updates. What's the easiest way to insert the code into the file? Edlin? Everything I've looked at is more complicated than I need (very unusual), the file name and directory is static and the string that needs to be inserted is static. Thanks in advance.




Sponsored Link
Ads by Google

Response Number 1
Name: bitbyte
Date: November 20, 2002 at 07:30:09 Pacific
Reply:

do you need to insert the text at the beginnig of the html file or in the header?


0

Response Number 2
Name: Secret_Doom
Date: November 20, 2002 at 09:39:10 Pacific
Reply:

This should add the string "New String" to the begin of FILENAME.EXT:

@echo off
echo New String> %temp%.\T1.DAT
copy %temp%.\T1.DAT+FILENAME.EXT > nul
copy %temp%.\T1.DAT FILENAME.EXT > nul
del %temp%.\T1.DAT

The problem is that the string must be ECHOable, so it must not contain the characters pipe (|), lower-than and greater-than.

If the line does contain one of those characters, since this file seems to be for personal use only (is it not?), you can put the string on a certain file and use that file on the place I've used %temp%.\T1.DAT on the script above (you would skip lines 2 and 5, of course). I don't think it's a good idea placing this permanent file on the %temp% directory.

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


ho do i Dir listings



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Inserting String into document

Insert String www.computing.net/answers/dos/insert-string/5882.html

Inserting text into files using some DOS www.computing.net/answers/dos/inserting-text-into-files-using-some-dos/7134.html

Hand Held Scanner www.computing.net/answers/dos/hand-held-scanner/9989.html