Jump to content

help

- - - - -

  • Please log in to reply
1 reply to this topic

#1
stevie754

stevie754

    Programmer

  • Members
  • PipPipPipPip
  • 110 posts
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"

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 ZekeDragon, 23 February 2011 - 09:01 AM.
Please use [CODE] tags (the # button) when posting code.


#2
mnirahd

mnirahd

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 330 posts
Hi,

One thing I noticed


if (fs.GetExtensionName(FileOrig).toLowerCase()=="sql "){



shouldn't it need to be


if (fs.GetExtensionName(FileOrig).toLowerCase()=="sql"){ //NO space after sql



rest of the code seemed to be fine. have you tried it running?

-Munir




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users