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

Eliminating lines begining with TAB

Status
Not open for further replies.

ale77

Programmer
Jul 18, 2003
38
US
Hi
I have a script that reads data in this format:
6PA4345345 545 445 445
3IK3413755 546 545 454
456OL74346 768 545 455
TOTAL 434

I want only the first column of every line, so I'm using substr($line,10,0). The problem is when it reads the " TOTAL" line because it has a TAB as the first character. How can I detect the tab character?

I though something like:
Code:
if ( index($prev_line, "/t", 0)) != -1)
print HANDLE_CUSIPFILEOUT "$prev_line\n"
but of course is not working.
Hope someone gives me an idea. Thanks
 
Thanks, but that was not the error because I typed like that in here, in the program was ok.
I made it work using "unless" instead of "if".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top