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!

string help

Status
Not open for further replies.

Neoport

Programmer
Aug 4, 2000
10
US
Hi,

I'm trying to design a database on a text file with the following format:

filename.dat<tab>&quot;information regarding the file&quot;
.
.
.

I was wondering if there's a function I can use to just copy out the filename.dat word from the long string. Because I will be displaying the filename content to the user.

thanks
 
I think I'll be doing the split function with the tab \t and it will separate the strings into an array, after this I'll assign the first element of the array as my filename.

Thanks
 
that will do it fine.

another way to do it (there's always more than one, i've heard) is this (assumes the line from the file is in $_)
[tt]
/\t/;
$_ = $`;
[/tt]

these two statements find the first tab character in $_ and then assign everything before that character to $_
Mike
michael.j.lacey@ntlworld.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top