[Show all top banners]

secondlife
Replies to this thread:

More by secondlife
What people are reading
Subscribers
:: Subscribe
Back to: Kurakani General Refresh page to view new replies
 URGENT: Computer (code) Help
[VIEWED 4667 TIMES]
SAVE! for ease of future access.
Posted on 08-20-09 10:38 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Hey Sajha Computer Gurus,

   I am new to  programming , pls help.. help. 

I have a makefile.exe program that takes a file(.txt ) format and changes to different format (.ms).
it works in command line(DOS) like this
 C:\> makefile.exe filename.txt  -ms      
 ( it creats filename.ms), 

But I have to run several( thousands) of those .txt file that need to be change in .ms format. I am wondering how can I give a command so that the it works automatically for all the text file that are in a  folder. i am looking some line of codes (in any programming languge) batch file or in command line mode.

I really need this urgently,

Thanks,
Slife

(FYI: file names are format are not real)

 
Posted on 08-20-09 10:49 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Try reading the files in vbcsript,,

create a loop to read the file in a folder
once the file is read, fire makefile.exe filename.txt  -ms    

do until there is no file in the folder..

simple

 
Posted on 08-20-09 11:01 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Just to make ur life easier

Set objFSO = CreateObject("Scripting.FileSystemObject")
objStartFolder = "C:\Scripts"

Set objFolder = objFSO.GetFolder(objStartFolder)

Set colFiles = objFolder.Files
For Each objFile in colFiles
 'ur command to create .ms file  goes here
'eg wscript.run  makefile.exe filename.txt  -ms    
Next

Disclaimer: not a fullcode 

 
Posted on 08-20-09 11:03 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Payaradeshbashiharu,

 Thanks for your quick response, can you pls provide me few more line of code(would be great if it's complete). I have no idea about vb script... though i have visual studio in my system. 
pls

Thanks
slife

 
Posted on 08-20-09 11:14 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Dim aWSHShell, bWSHShell ,c
Set aWSHShell = CreateObject("WScript.Shell") 
Set objFSO = CreateObject("Scripting.FileSystemObject")
objStartFolder = "C:\Scripts" 'Ur folder path

Set objFolder = objFSO.GetFolder(objStartFolder)

Set colFiles = objFolder.Files
For Each objFile in colFiles
c=objFile.Name 'variable to hold file name
 aWSHShell.Run "makefile.exe c  -ms "
Next


I don't have a Windows Box ...and haven't tested it ..but if there's any error minor tweak will do the trick..

save the above code with .vbs extension..to execute the code simply right click and open it...

hope it helps u

 
Posted on 08-21-09 12:02 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Payaradeshbashiharu,

 Thanks alot for your great help, It worked (made some modification), but it just gave me one output(just for 1 file) as i mentioned earlier i need a loop so that it should do for all the file.

how to make just read 1 file at a time and modify that  and 
take next file................... ?

Cheers!

 I really appreciate your help and humbled by your support

Slife


 
Posted on 08-21-09 10:24 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

pyaradeshbasiharu,


Thanks for all your support, though it created a file on required format, it's just a templete( just ~50kb size) actually it should be bigger one. and also I need the .ms file name same as .txt file.


complete code would be great,


thanks a lot.


Cheers!



slife


 
Posted on 08-21-09 11:23 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 


U will get the Answer here...Look at "Changing File Extensions"..Minor tweaks in program will help u..

 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 365 days
Recommended Popular Threads Controvertial Threads
शीर्षक जे पनि हुन सक्छ।
NRN card pros and cons?
TPS Re-registration case still pending ..
What are your first memories of when Nepal Television Began?
Anybody gotten the TPS EAD extension alert notice (i797) thing? online or via post?
TPS Re-registration
Democrats are so sure Trump will win
Basnet or Basnyat ??
TPS EAD auto extended to June 2025 or just TPS?
nrn citizenship
Toilet paper or water?
Sajha has turned into MAGATs nest
Nas and The Bokas: Coming to a Night Club near you
ढ्याउ गर्दा दसैँको खसी गनाउच
Mamta kafle bhatt is still missing
ChatSansar.com Naya Nepal Chat
whats wrong living with your parents ?
डीभी परेन भने खुसि हुनु होस् ! अमेरिकामाधेरै का श्रीमती अर्कैसँग पोइला गएका छन् !
3 most corrupt politicians in the world
अमेरिकामा बस्ने प्राय जस्तो नेपालीहरु सबै मध्यम बर्गीय अथवा माथि (higher than middle class)
Nas and The Bokas: Coming to a Night Club near you
TPS Update : Jajarkot earthquake
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters