Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with a batch file

Status
Not open for further replies.

Jody72

IS-IT--Management
Sep 3, 2003
16
US
I've got a file, let's call it test.acl and it contains text such as this:

1 PARTNO 2628A2101-101 OP 300 MAZAK 11/18/03 REV N/C
1 PPWORD/FOFF , 317
1 PPWORD/OIL , 318
1 PPWORD/EAIR , 319
1 PPWORD/HTL , 320
1 PPWORD/RETRTZ,1310
16 SEQNO/1,INCR,3
18 DISPLY/ON

What I need is a batch file that will strip out the first 8 columns, basically up to the actual commands and then resave the file as *.cl in plain text.

I have no prior knowledge of programming or anything. And I'm not sure where to start. Any help would be appreciated.

Jody
 
Forgot to mention, the beginning file will always have the extension of .acl and should always be saved with .cl. So test.acl would become test.cl, test1.acl would become test1.cl, and so on.
 
If you always want to strip away the first 8 characters, you could use something like this:

dim Hold as string
dim hold2 as string
dim LinLen
open "c:\data\Test.acl" for input as #1
open "C:\Data\test.cl" for output as #2

do until eof(1)
line input #1, hold
LinLen=len(hold)
hold2=right(hold,linlen-8)
print #2,hold2
loop

close #1
close #2
 
I just reread your post, and noticed you said you're not a programmer. Since you posted in the Visual Basic forum, I assumed you had a copy of VB and knew how to use it.

If you've got VB, just make a form, add a command button, and paste the above code into the "on click" event.

You'll need a little more code to make it work for other file names, etc. If you respond back, I can explain how to make it work (I could even create a simple program and email it to you, if you want).
 
Thanks for you help thus far. I have access to Visual Basic. It's just at work my boss is wanting me to broaden my horizons so to speak. I want to learn, guess I just need some guidance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top