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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Tree for Windows DIR command

Status
Not open for further replies.

janhes

Technical User
Jan 30, 2001
537
GB
Has anyone been able to create a Type Tree for the output of a DIR command in windows that works across all versions? If the results are piped to a file or input card, the format is different for different versions of windows - at least it is between XP and Win2K.
 
What are you trying to extract from the dir command?
What is your dir command line?



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
The DIR command is
dir \\sv_nt_gos150\solveSE\trans1 /O:D /T:C

on XP this gives me an output like
Code:
 Volume in drive M is EMC
 Volume Serial Number is 2C35-36D2

 Directory of m:\trans1

12/12/02  11:10    <DIR>          ..
12/12/02  11:10    <DIR>          .
01/08/05  08:15           691,236 05080101.TRX
02/08/05  08:22           455,364 05080201.TRX

On windows 2000 it comes out like

Code:
 Volume in drive J is EMC
 Volume Serial Number is 2C35-36D2

 Directory of j:\trans1

15/05/2006  08:06       <DIR>          .
15/05/2006  08:06       <DIR>          ..
01/08/2005  16:34              691,236 05080101.TRX
02/08/2005  16:41              455,364 05080201.TRX

The date is the creation date. I need to extract files with a creation date in a certain range.

The date parameter /4 doesn't have any effect on the 2 or 4 character year in either environment.
The problem I have had is the size of the fields after the time. My solution was to just specify everything after time as a single string and use the WORD function to get the file name. I have the date and time terminated by <SP>
 
Text blob terminated with ..<NL> (or .NL), could be syntax item.
Date field terminated with " "
Time field terminated with " " enough spaces not to hit the size data.
Number field with optional leading spaces, terminated with " "
Text field. Date to text fields in a group terminated with <nl>





BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
I can't getthe size field to work. it fails with

(Level 3: Offset 293, len 0, comp 3 of 4, #1, DI 00000001:)
Data at offset 293 (' 691,236 0...') fails minimum size requirements
TYPE X'000B' (Size Items ROOT).

I have it specified as

Number
Character
Min size 3
Max size not specified
Pad Yes
Value <SP>
Padded To Min Content
CountTowardsMinContent No
Justify Right
Apply Pad Fixed Group
Terminator Literal
Value <SP>

It looks like it's picking up the terminator before the pad characters.
 
Try pad to fixed size. Give it the maximum size that would be seen.


BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
That makes no difference. Same error message in the trace.
 
Looks like it is seeing the space after the data as padding. Might want to make that a fixed 1:1 element with a restriction of <SP>



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top