Jump to content
Sign in to follow this  
rds_correia

reading a text file

Recommended Posts

rds_correia

Newbie alert!

I'm new to AutoIt and I really liked what I've seen from it so far.

Lot's of Kudos to the devs team.

I happen to have the need to read a text file and to count some repeated text chuncks.

For instance, here's a small portion of my file:

DGIndexProjectFile11
1
D:\MATRIX_I\VOBS\VTS_02_1.VOB

Stream_Type=1
MPEG_Type=2
iDCT_Algorithm=2
YUVRGB_Scale=1
Luminance_Filter=0,0
Clipping=0,0,0,0
Aspect_Ratio=16:9
Picture_Size=720x576
Field_Operation=0
Frame_Rate=25000
Location=0,0,0,28CF8F

d00 1 0 2048 2 1 b2 b2 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
900 1 0 81920 2 1 32 32 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
900 1 0 157696 2 1 32 32 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
900 1 0 421888 2 1 32 32 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
900 1 0 851968 2 1 32 32 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
900 1 0 1286144 2 1 32 32 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
900 1 0 1839104 2 1 32 32 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
900 1 0 2508800 2 1 32 32 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2

Now let's look at one of the relevant lines:

900 1 0 2508800 2 1 32 32 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2

And finally the relevant info on that line:

32 32 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2

This line should count 15 items.

Do you think it's possible to create a script that can count the total items in this kind of file and store it in a variable?

Can you give me some hints on how to do it?

Many thanks in advance.

Cheers

Share this post


Link to post
Share on other sites
SmOke_N

Do you know what the string is ahead of time your looking for? Sorry, I confuse easily, and don't want to attempt trying to help in this, and write a totally useless UDF trying to help.

If you were to do it by hand ( :P yuck :lmao: ) can you give the exact steps you would take to achieve what your wanting...


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×