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

Reading pipe delimited text from file to html

Status
Not open for further replies.

Guru2B

Programmer
May 24, 2000
77
GB
Hello,<br><br>I am trying to read name, address, phone number etc from a file with Perl and build an html page from that info. <br><br>The file contains about 15 fields all delimited by '¦' and the records are seperated by a newline.<br><br>Can anyone tell me how to accomplish this.<br><br>Thank you<br>
 
Here's what I normally do, in a nutshell, with some bits added for your specific situation:<br><br>Start off the HTML page.<br>Open the input file.<br>Read the input file line by line.<br>Use <FONT FACE=monospace>split</font> to break up the current line.&nbsp;&nbsp;(eg, <FONT FACE=monospace>@Items = split(&quot;¦&quot;, $Current_Line</font>).<br>Print out the current items in the required format.<br>Close the input file.<br>Close off the HTML.<br><br>Hope this helps, but let us know if you still have problems.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top