hiteksoftware.com Forum Index hiteksoftware.com
User discussion forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RegEx Issue Help Please!
Goto page Previous  1, 2
 
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Frequently Asked Questions
View previous topic :: View next topic  
Author Message
jkrfs



Joined: 27 Mar 2010
Posts: 47

PostPosted: Wed Jul 21, 2010 12:35 pm    Post subject: Reply with quote

how bout a way to strip the parenthesis so that i can move it/rename after?
Back to top
View user's profile Send private message
jkrfs



Joined: 27 Mar 2010
Posts: 47

PostPosted: Thu Jul 22, 2010 10:27 am    Post subject: Reply with quote

Heres my current fix, not the most elegant but it works.

I created a script and inside the script I wrote a bit of java code (easily found all over the internet, thx google!)

import com.hitek.engine.mods.script.Script;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

//This method does the file copy work
void copy(String fileIn, String fileOut)
{
File fromFile = new File(fileIn);
File toFile = new File(fileOut);

File parent = toFile.getParentFile();

if(parent != null && !parent.exists())
{
parent.mkdirs();
}

InputStream inStream = new FileInputStream(fromFile);
OutputStream outStream = new FileOutputStream(toFile);

byte[] buf = new byte[4096];
int bytesRead;

while((bytesRead = inStream.read(buf)) > 0)
{
outStream.write(buf,0,bytesRead);
}
inStream.close();
outStream.close();
}


// We are using the copy function to rename the files.

copy("E:\\Test\\05A-950138 (Ind).pdf", "E:\\Test\\NewFileName.pdf");

--

Hopefully this will help anyone who has the same issue.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Frequently Asked Questions All times are GMT - 8 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group