DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2004
    Posts
    5

    JS driven external file parser

    I'm attempting to find or create a script to parse an external plain text file into an easier to read and more organized format. Any tips, links, pre-written scripts, and suggestions are greatly appreciated.

    Thanks In Advance

  2. #2
    Join Date
    Jun 2004
    Posts
    199
    Need more detail as to what "Easier to read" means.

  3. #3
    Join Date
    Aug 2004
    Posts
    5
    I want to take an external file say something like

    ⌡jimbo's config file⌡version 1.3.2⌡username: someguy⌡password hash: axDf718163b32f9cCd819362⌡last login: 6-18-04⌡keep track of multiple users: no⌡keep login history: no⌡check for latest updates at launch: yes⌡create logfile: yes⌡logfile path: c:\jimbos domain\jimbo client\jimbo\bin\logs\⌡logfile name: craptastico.log⌡

    and parse the input so it can be turned into variables which can be edited by a form then outputted to a replacement file in the format above. i can extrapolate the modifications and what not needed from a script that does something similar. (I'm just not that fluent with the syntax and commands available so i need something similar which i can learn from.)

    if this doesn't help i can be more specific. of course the info in the examble is all ficticious

  4. #4
    Join Date
    Jun 2004
    Posts
    199
    by script do you mean JavaScript? Or do you want to do this with the Java language/platform?

  5. #5
    Join Date
    Aug 2004
    Posts
    5
    Of course. I wouldn't be refering to a real language as a scripting language, or vise-versa. All I really need is some assistance finding the right calls to make and the proper syntax for doing so, a similar script would provide all I need to make my own that does what I want. Thank you for your intrest, I look forward to your reply.

  6. #6
    Join Date
    Jun 2004
    Posts
    199
    The reason I asked was:

    1. I needed to know how to answer the question because the anwer is different for each language.

    2. You were asking about JavaScript in a Java forum.

    So for Javascript, if you are doing this on windows, use create a MS Scripting object and read in the file, parse it by pipebar and format each section, maybe with HTML tags, and write it out with another scripting object. For usage see: http://www.developer.com/net/vb/article.php/781481

  7. #7
    Join Date
    Aug 2004
    Posts
    5
    My apologies, i haven't had any caffeine this week. (yeah.. only valid excuse I have.) I appreciate the assistance. Again thank you very much.

  8. #8
    Join Date
    Jun 2004
    Posts
    199
    No problem. Mucho people confuse Javascript with Java. And most can't blame lack of coffee or guarana.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links