Starmanager64
September 9th, 2002, 05:44 PM
I am trying to locate a solution to load text files into HTML document without cutting/pasting into layer or new file.
S64
S64
|
Click to See Complete Forum and Search --> : Loading text files to Html Starmanager64 September 9th, 2002, 05:44 PM I am trying to locate a solution to load text files into HTML document without cutting/pasting into layer or new file. S64 ShawnDev September 9th, 2002, 06:53 PM If your webserver supports Server Side Includes: <!--#include file="path/to/file.txt" --> Spacing is important (there is no space in front of the # symbol above). Starmanager64 September 10th, 2002, 08:43 PM Originally posted by ShawnDev If your webserver supports Server Side Includes: <!--#include file="path/to/file.txt" --> Spacing is important (there is no space in front of the # symbol above). Thanx for the help ShawnDev, the include file worked well, however, now I have to reformat the text file with Breaks..etc.. :) Unless you have a trick for that one too? :) Thank you again. Starmanager64 / Tom ShawnDev September 11th, 2002, 12:50 AM Not with straight HTML. Some server-side scripting would allow you to parse (and alter the file) but HTML alone doesn't allow for this functionality. How is the file getting built? And is it being used by anything else? Could you create it with the breaks and other formatting in place? Starmanager64 September 11th, 2002, 12:02 PM Originally posted by ShawnDev Not with straight HTML. Some server-side scripting would allow you to parse (and alter the file) but HTML alone doesn't allow for this functionality. How is the file getting built? And is it being used by anything else? Could you create it with the breaks and other formatting in place? Hi ShawnDev, the intention is to allow people to either attach a text file or have us post their information (resume) using a text file. I/we are trying to automate as much of the content as we can. Starmanager64 ShawnDev September 11th, 2002, 03:48 PM Well, just including the raw text would be easiest (and this is what most online resume sites do). But if you're feeling ambitious, you could write server-side code to parse the resume. That's going to be quite an understaking though - unless you establish some guidelines for how things like headers and bullet points must be portrayed in the plain text file. Starmanager64 September 11th, 2002, 05:27 PM Thanx Shawn, I will have to put some thought into that. I am not sure whether we want to either instruct the users making their posting to add the <BR> tags..etc. Personally, I would rather automate it. Afterall, the site that our group us undertaking is not just another resume site.. curious..? :) We could use extra input. However, your reply's are greatly appreciated and if there is something I can assist you with, please let me know. Tom Waldo2k2 September 11th, 2002, 05:55 PM Are you only using HTML? If you use a server side language like ASP, PHP, or even Perl you could do it. If you know one of them tell us and we could come up with an answer....good luck. On the side, how are you getting the text files from your users? Starmanager64 September 11th, 2002, 07:00 PM Originally posted by Waldo2k2 Are you only using HTML? If you use a server side language like ASP, PHP, or even Perl you could do it. If you know one of them tell us and we could come up with an answer....good luck. On the side, how are you getting the text files from your users? Hi Waldo, the site is all ASP, ADO, SQL and access. We are using a form "type=file" tag to have the users attach their files, including photos. Your response is appreciated and any additional thoughts you might have.:) Tom / Starmanager64 Waldo2k2 September 11th, 2002, 07:51 PM ok, so from what you've said, seperate peices of the resume are in different from fields? if so that's perfect. Do you know XML? if not it's not like pulling teeth, you could pick up what you needed in 15 minutes (especially since you're only going to be dealing with formatting text) basically, you set up a DTD (tells what the tags are) then use ASP to write tags to a text file (saved as .xml) <name> John Doe </name> and so on. Since they're all in seperate feilds they are already seperated, just add the tags. Now, the reason you use XML is because it has a sister technology called XSL which spits out formatted XML. Very easy to use. Once again should only take you 15 minutes to get the hang of it. Now if you think this is a good idea check out www.w3schools.com , they have great XML and XSL tutorials. They also have stuff on ASP so they may have some extra stuff you can do with the languages in conjunction. But in my professional opinion this would be much more manageable than using server side includes of text files then messing with breaks and junk. There's several things you could do including putting the xml file into an inline frame of an asp page....to just opening the xml file (due to xsl it will format into a normal web page...no limitations on the code you want to stick in.) Anyhow good luck, if you have more questions feel free to ask. Starmanager64 September 11th, 2002, 08:20 PM Hi Waldo, thanx for your help. I have only basic knowledge of XML, I have not done anything with it as of yet, but always willing to learn something new. I will check out the link you placed in the message for information, and perhaps test a few idea's - thank you again. I am on a limited time frame before launching our demo, with that in mind, I have to take a look at XML Tom ShawnDev September 12th, 2002, 01:06 AM Waldo, as I understand it, Starmanager isn't pulling data from individual fields. S/He's getting a raw text file (of their resume) that the user is uploading. S/He needs to parse and format that file to add any HTML formatting s/he desires and then insert it into another HTML document. Starmanager, you can either do this with ASP (look at the Scripting.Filesystem Object) or with any other language/compiler/script you feel comfortable (VB, C++, Perl, etc.) The main point is that this step doesn't really have to be part of the server-client communication - it happens behind the scenes, as it were. Your automated flow will go something like this: 1) User uploads file. It gets placed in default upload directory. 2) An external process (although perhaps spawned by the ASP upload completed event) opens the file, parses it and adds the necessary HTML markup. 3) The modified file is copied to the location where it will be included in the HTML page. The discussion has strayed far outside the bounds of Client Side Scripting, however ;) Starmanager64 September 12th, 2002, 02:48 AM Hi Shawn, ya know I have spent more time on this site and this forum in the last 3-4 days than I have tending to other matters. But your right about this discussion going far beyond server side scripting. However, I started here and found some awesome idea's from you and Waldo. I have now been encouraged to review XML. I believe there is no such thing as not enough knowledge. But I can say this, you were right about your flow of the program. We take the information, put it in another file -parsed- then transfered with HTML tags into an ASP page, if it will make a difference, these files will be loaded using query strings and session variables based on request. Tom - Starmanager64 codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |