Edited by stevie754, 23 February 2011 - 03:28 AM.
Post confused even me
4 replies to this topic
#1
Posted 23 February 2011 - 03:24 AM
Never Mind i cracked it :) thank god for Google
|
|
|
#2
Posted 23 February 2011 - 05:08 AM
#3
Posted 23 February 2011 - 06:24 AM
Hi again
There is more to this code just this seemed like the bit important to what im doing.
I need to get the program to read from the param file and change the string to "XXXXXX"
any ideas?
Thanks
There is more to this code just this seemed like the bit important to what im doing.
I need to get the program to read from the param file and change the string to "XXXXXX"
for (enumtor = new Enumerator(folder.Files) ; !enumtor.atEnd(); enumtor.moveNext())
{
try
{
//Get File
FileOrig=fs.GetFile(enumtor.item().Path);
//If FILE SYSTEM extension equals SQL
if (fs.GetExtensionName(FileOrig).toLowerCase()=="sql"){
//Open Original File
f = FileOrig.OpenAsTextStream(1,0);
//Create tmpFile
var FileName = enumtor.item().Path;
FileTemp = fs.CreateTextFile(FileName+".tmp", true);
while( !f.AtEndOfStream ){
content = f.ReadLine();
while (content.indexOf("_flodsOwner_")>-1){
content = content.replace("_flodsOwner_",param);
}
FileTemp.WriteLine(content);
}
f.Close();
FileTemp.Close();
}
}
catch(e){}
}
any ideas?
Thanks
Edited by Alexander, 24 February 2011 - 05:23 PM.
#4
Posted 24 February 2011 - 05:05 AM
Do you know what the string is specifically? Can you post the contents of the param file? If you're trying to replace a specific string with "XXXXXX" you should be able to read the file and when the file finds the specified string tell the program to replace that with "XXXXXX".
-CDG10620
Software Developer
Software Developer
#5
Posted 24 February 2011 - 06:56 AM
I know what string it is I have to change, however the params file should be editable so that more can be added to the list of strings.
Since first posted i have created an array for the parameter to load into and while the rest of the code runs through the destination folder i will run a replace method that will do what i need.
Thanks for posting back anyway.
Since first posted i have created an array for the parameter to load into and while the rest of the code runs through the destination folder i will run a replace method that will do what i need.
Thanks for posting back anyway.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









