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!

tabs and spaces in file

Status
Not open for further replies.

jinkys

Programmer
Sep 11, 2003
67
GB
I have a text file with 1 line in that is fixed length. The line can be padded with spaces and/or tabs. I am getting the one or more inputs invalid error and have tried multiple ways in the type tree to handle this without success. How can you allow padding to be used for tabs and/or spaces?

My line looks like this:-
A<SP>B<HT><SP>CDE<SP>F

Type tree settings:-
Item Subclass: Text
Interperet as: Character
Size (content) : min : 0
: max : 1000
Pad: Yes
Value: <SP>
Padded To: Fixed Size
Length: 1000
Justify : Left
Apply Pad : Any context

Any ideas, I have whats known as "Mercator head" looking at this and I know there'll be a simple solution?



 
Hi,
The error might be because u might have set ur delimiter as TAB or sapce in that particular record if that is the case then try to change the delimiters.

If it is not the above case please let us know more about the group properties where this field resides.

Cheers,
Shrini.
 
jinkys

This is a common problem in Edi where there are different delimiter types.
The solution is to create a new item in the tree of type Syntax and assign it some values (in your case <SP> <HT>)

Then in the group definition for your line of data the delimiter is a variable and the Item value is the Syntax object you created.

Use the Find=Yes option to get the parser to check it every time through otherwise it sticks with the first value it finds.

Tim
 
Tim

I'm not sure I'm explaining myself properly or understading what you are saying. The tabs and spaces appear within a single text item and may or may not have a tab within there. The text item is fixed length. I think the problem is that it is padded using spacesbut don't know how to get around this.
 
<OWSP> as the pad character works

Thanks for your all the ideas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top