Aronya1
12-12-2005, 11:47 PM
CGI ignoramous here, so please be kind. Here's what I'm trying to accomplish:
I have a CGI script that will read a .txt file and input the contents to a .shtml file. The contents of the text file are currently pipe ( | ) delimited. I need to be able to change to tab delimited.
Here is the code that I think is in question (no doubt, I'm wrong):
From the .cgi file that creates the .txt file:
print FILE "$in{'id'}|$in{price}|$in{ft2}|$in{beds}|$in{baths}|$in{city}|$description|$in{'picture'}\n";
From the .cgi file that outputs to .shtml:
PrintTag
foreach $i (@indata)
{
chomp($i);
($id,$mls,$price,$ft2,$beds,$baths,$city,$description,$picture) = split (/\|/,$i);
My best guess is that in the first instance I need to replace the pipe characters with whatever symbol will represent a tab, and in the 2nd instance, I need to edit the last little bit: split (/\|/,$i);
Any help would be appreciated. I can post more of the code if needed. Just trying to be conservative.
Many thanks.
Tim
I have a CGI script that will read a .txt file and input the contents to a .shtml file. The contents of the text file are currently pipe ( | ) delimited. I need to be able to change to tab delimited.
Here is the code that I think is in question (no doubt, I'm wrong):
From the .cgi file that creates the .txt file:
print FILE "$in{'id'}|$in{price}|$in{ft2}|$in{beds}|$in{baths}|$in{city}|$description|$in{'picture'}\n";
From the .cgi file that outputs to .shtml:
PrintTag
foreach $i (@indata)
{
chomp($i);
($id,$mls,$price,$ft2,$beds,$baths,$city,$description,$picture) = split (/\|/,$i);
My best guess is that in the first instance I need to replace the pipe characters with whatever symbol will represent a tab, and in the 2nd instance, I need to edit the last little bit: split (/\|/,$i);
Any help would be appreciated. I can post more of the code if needed. Just trying to be conservative.
Many thanks.
Tim