Jump to content

SQL

- - - - -

  • Please log in to reply
4 replies to this topic

#1
stevie754

stevie754

    Programmer

  • Members
  • PipPipPipPip
  • 110 posts
Never Mind i cracked it :) thank god for Google

Edited by stevie754, 23 February 2011 - 03:28 AM.
Post confused even me


#2
cdg10620

cdg10620

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 389 posts
Google is my bff. :)
-CDG10620
Software Developer

#3
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 Alexander, 24 February 2011 - 05:23 PM.


#4
cdg10620

cdg10620

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 389 posts
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

#5
stevie754

stevie754

    Programmer

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




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users