Renaming and Writing to Notepad

Started by winuser2003, November 14, 2015, 09:08:38 AM

Previous topic - Next topic

winuser2003

I have about 600 items I need to rename in a notepad file...

for example in my notepad file its
www.google.com and I need to rename this like www.google1.com and write it to a notepad pad. I can set a variable to input. This is a long way I know thinking about this... this is what I got so far though...

DOCID1 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
DOCID2 = AskLine("Doc ID", "Please Type Doc ID 2 and Click OK", "")
id = FileOpen("C:\Documents and Settings\All Users\docid.txt","WRITE")
FileWrite(ft,"http://test.rds.test.com/assets/download/%DOCID1%/low_res/master")
FileWrite(ft,"http://test.rds.test.com/assets/download/%DOCID2%/low_res/master")


The problem is though I would have to write in 600 variables to write to the txt file. I would rather the script just ask me what ID Number and it just adds line after line until I get to the 600th ID. I hope this makes sense. I also could be using the completely wrong method as well doing this. Thanks for your alls feedback.

winuser2003

I am sure there is a much easier way to do this... than the way I have...

:REDO
SECUREID1 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID2 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID3 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID4 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID5 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID6 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID7 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID8 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID9 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID10 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID11 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID12 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID13 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID14 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID15 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID16 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID17 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID18 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID19 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")
SECUREID20 = AskLine("Doc ID", "Please Type Doc ID and Click OK", "")

ErrorMode(@NOTIFY)
ft = FileOpen("C:\Users\Jeff\Desktop\wlogs\user.txt","WRITE")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileWrite(ft,"ID: http://xxx.rds.xxx.com/assets/download/%SECUREID1%/low_res/master")
FileClose(ft)
exit
                                                                                                                                                                                         

td

I am not sure exactly what it is you are trying to do.  If you just want to create a file with some user supplied content then you could simple open up Notepad and start typing.  If that is not the case and you have some other source for your content or you want to verify the new content as the user supplies it then a script might be appropriate.    For example, if verification is your goal, you could create a dialog that displays the existing content of each line and an input field to modify each line.  If you have some source like an algorithm for your modifications then opening your file and stepping through each line would be appropriate in a script.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade