Parsing (if that is the right word) through a directory.

  • Thread starter Thread starter Kardon Coupé {Aka Paul}
  • Start date Start date
K

Kardon Coupé {Aka Paul}

Here is the deal, I would like to examine a folder containing files, read
each file name, read the first two bytes of the file, convert the two bytes
into hex, so if the two bytes where 01 08, the hex returned would be 0801,
then add $ (becoming $0801) and adding this to the beginning of the
filename.

So "testfile_01.prg" would become "$0801 testfile_01.prg"

the whole string manipulation I will be able to do, but the whole examining
the directory, and renaming function, is beyond me..(well at the moment
anyhow)

Can anybody help me please..

Thanks..
 
Hi Kardon,

\> wow, that is more complicated that I thought.....:(

I do not think so, I would just start if I was you.

Push below on that page on "file" and than look for the filemove.

I thought that there is a comple sample.

I hope you have now all the information you need, to get it more simple?

Cor
 
* "Kardon Coupé {Aka Paul} said:
Here is the deal, I would like to examine a folder containing files, read
each file name, read the first two bytes of the file, convert the two bytes
into hex, so if the two bytes where 01 08, the hex returned would be 0801,
then add $ (becoming $0801) and adding this to the beginning of the
filename.

So "testfile_01.prg" would become "$0801 testfile_01.prg"

the whole string manipulation I will be able to do, but the whole examining
the directory, and renaming function, is beyond me..(well at the moment
anyhow)

Enumerating files/folders:

<http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/RecursiveFileScan.zip>

Renaming files: 'Rename'.
 
Back
Top