Parse TEXT File??

Hi,
I am using CF 8
I have a text file (mylog.txt) that currently stores login
information for our users. I need to parse and extract some basic
information from the file and I am having a hard time. I need to
know the following
1. A list of all UNIQUE email addresses that appear in the
text file.
2. A count of how many times each email address appears
Each time a user logs on a "new line" is entered in the text
file. Here is some sample data:
[1/05/08 1:15:31 PM] User [email protected] logged in.
[1/11/08 3:57:30 PM] User [email protected] logged in.
[1/12/08 8:33:17 PM] User [email protected] logged in.
[2/17/08 6:37:07 AM] User [email protected] logged in.
[2/19/08 3:57:30 PM] User [email protected] logged in.
I would like to parse the text file and then output my
results to the screen. The output should look like this, note John
logged in twice:
Email Address | Count
[email protected] 1
[email protected] 2
[email protected] 1
[email protected] 1
The prior user here should have stored this in the database
but for now I still need to get at this data.
Any help appreciated.
Thanks,
-Westside

You can use cfhttp to convert your file variable to a query
and use query of queries to count email adddresses.

Similar Messages

  • Can I parse Text files in Java Script to populate in select boxes.

    The scenario is as follows:
    I have two select boxes, the second one depends on the first one for its values.
    Values corresponding to the selection made in the first select box are available in a text file.
    Can I parse the text file to fill in the values in the second select box through javascript?
    Can any one please help.
    Thanks,
    Ramesh

    This isn't a javascript forum. Java is not Javascript and Javascript is not Java.
    If you actually meant Java...the answer is "maybe, depending on what you're doing".

  • Parsing text files

    I have written a vi that parses data out of text files which makes use of the open text file vi. When I compile the vi to run as a stand alone application, The open file dialogue will only accept .vi files for opening. Why is this?
    Thanks,
    Russ T.

    Without looking into your program, I am going to guess the following:
    If you are using Open/Create/Replace File.vi, wire in "*.txt" to Pattern.
    Hope that helps.
    Shan Pin Koh
    Systems Engineer
    Oakriver Technology

  • How to parse text file?

    Hi,
    I would like to read data from a text file that my program has created.
    This is what I have when I create my file:
    try
                   File file = new File("/Users/seifmouelhi/Desktop/Output.txt");
                   FileOutputStream out = new FileOutputStream(file);
                   PrintStream print = new PrintStream(out);
                   System.setOut(print);
              catch(Exception e)
                   System.out.println("set system out failed!!!!!");
                   System.out.println(e.toString());
                   System.exit(0);
    and what can I use to parse this file?
    every word is separated with a "\t". I used MyString.split("\t"), but is returns me back null value...
    What can you advise me?
    Thanks a lot!

    Well, here is the short code:
    private static int aX;
    private static int X;
          * @param args
         public static void main(String[] args) {
              BufferedReader entree = new BufferedReader( new InputStreamReader(System.in));
              String cmd = "";
              String type="";
              try {
                   cmd = entree.readLine();
                   String[] res = cmd.split("\t");
                   if(res[0]=="accelero"){
                        type="accelero";
                        aX = Integer.parseInt(res[1]);
                   else if(res[0]=="touch"){
                        type="touch";
                        X = Integer.parseInt(res[1]);
                        System.out.println("touch:"+X);
                   else if(res[0]=="0.0"){
                        type="data";
                   System.out.println(type);
                   System.out.println("accelero:"+aX);
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              String[] rix = cmd.split("\t");
         }when you try this code, you should write (for example): accelero 35
    there is a \t between accelero and 35, and I want the system to print accelero, and 35 once the full string was split.
    System.out.println(type); --> prints nothing
    System.out.println("accelero:"+aX); --> prints accelero:0
    I want simply to use the res. It seems like the string.split doesn't work in this example.

  • Parsing text file with SGML tags

    <EMAIL>
    <ADDRESS>>[email protected]
    <DESC>>Email your questions to Click Here to E-mail
    <POP>
    <ADDRESS>N/A
    <ZIP>N/A
    How do you parse above text file which has SGML tags ? thanks

    Oh, sorry, if it's not an XML-file, then you properbly should use another approach. Where does the file come from? Could you properbly make it be a xml file ? ;-)
    Possible approaches are:
    * StringTokenizer, possibly with returning delimiters option enabled
    * good old make-it yourself indexOf/substring-method, ok... complicated
    * if you would like to handle the contents exactly like xml you could add a <?xml version="1.0"?><root> in the beginning and a </root> in the end and still use an xml parser, but keep character encodings in mind here.
    * another quite simple way that properbly fits best is java.util.regex API. if you want to use it, I can give you the code. it's easy.
    regards
    sven

  • Parse text file and retrieve data

    Hi,
    I have a log file with comma separated entries in each line. Each line has about 50 or more integer values logged for statistical analysis. What i need to do is to be able to parse this text file Line by line and retrieve data say nth entry in each row of file. Basically, like i need a certain column from a table. Column selection may vary. I can have user need 10th entry or 25th entry or more than one entries.
    Please help me with suggestions for how to do this efficiently . Keep in mind log file can be huge at certian times.
    Thanks
    -Anupma

    here's something to get you started
    public void parseFile(File file) throws IOException{
        String lin = null;  // string to hold each line in the text file
        BufferedReader in = new BufferedReader(new FileReader(file));
        while ((line = in.readLine()) != null){
            processLine(line);
    public void processLine(String line){
        String tokens = line.split(",");     // tokenize the line - deliminator is a comma
        for (int i = 0; i < tokens.length; i++){
            try{
                int num = Integer.parseInt(tokens);
    System.out.println(" The integer is = " + num);
    catch(NumberFormattedException ee){}

  • Parse Text-File into array

    Hi,
    I hava a text-file with a structure like this.
    "sfdgasdf" "sadsadsadf" "sadfsdfasfd"
    "qwevsdf" "sdgfasdfsafd" "yxvcyxvcyxvc"
    "hgfddfhhfdfdf" "ewrtqwrwqewqr" "dfgdgdgsdgsdfgsdgg"
    My aim is to read this text-file (*.txt) and parse it into an string-array (or whatever is the best). The contents between the apostrophes should be inserted in this array line by line.
    For example:
    array[0][0] = "sfdgasdf";
    array[0][1] = "sfdgasdf";
    array[0][1] = "sadfsdfasfd";
    array[1][1] = "qwevsdf";
    How can I achieve this?
    Thanks
    Jonny
    That's how far i came (not very far).
    File file = new File("c:\temp\text.txt");
    FileReader stream = new FileReader(file);

    Hi,
    still facing some problems.
    My text which I want to parse:
    "sfdgasdf" "sadsadsadf" "sadfsdfasfd"
    "qwevsdf" "sdgfasdfsafd" "yxvcyxvcyxvc"
    "hgfddfhhfdfdf" "ewrtqwrwqewqr" "dfgdgdgsdgsdfgsdgg"
    My code:
    String[] parse = text.split("\"");
    The array that is created has whitespaces and linebreaks as elements. I only want the characters in beween the apostrophes.
    How can I "tell" the split function not to insert them in my array?
    Cheers
    Jonny

  • Server Side Includes for Apache and parsing text files

    I have an old website I used to do zipped up and I decided to set it up on my personal webserver in OS X . I got apache configured to allow server side includes (edited the httpd.conf to all them:
    <Directory />
    Options FollowSymLinks Indexes MultiViews Includes
    AllowOverride None
    </Directory>
    But I can't get the pages to come up. See I have this .shtml page which loads fine and a part of it has this line:
    <!--#include file="news/news.txt" -->
    But it won't parse that txt file and show the html that its formatted in.
    Anyone have any ideas on how to get it to parse that txt file? Even if I load just that txt file it shows raw code not it formatted. Please help.

    Ignore that first reply. I thought I was dealing with server.
    As usual, I fogot to make sure that Includes was in the Options directive for the DOCUMENT_ROOT or VirtualHost. After 10 years, you'd think I'd remember that. I just configged one of my macs to do SSI. Here's the 3 lines that I changed:
    Line 399 (the DOCUMENT_ROOT definition): Options Indexes FollowSymLinks MultiViews Includes
    Line 887 (To use server parsed HTML): AddType text/html .shtml
    Line 888: AddHandler server-parsed .shtml
    apachectl restart
    and off it went!
    Roger

  • How to parse text file (.eml) to get index of line, that contains Subject, From field, and base64 decoded Body

    Hello, Dear Colleagues.
    Help me please with next deal.
    As input I have .eml file:
    x-sender: [email protected]
    x-receiver: ***************************
    Received: from ***** with Microsoft SMTPSVC(7.5.7601.17514);
    Fri, 20 Mar 2015 12:43:03 +0200
    In-Reply-To: <********@LocalDomain>
    To: *****************************
    Bcc:
    Subject: Incident ID#: 117 Something wrong, something right, something missing
    Message-ID: <*****************************@LocalDomain>
    From: [email protected]
    Date: Fri, 20 Mar 2015 12:42:55 +0200
    Content-Type: multipart/related; boundary="=_related ********************"
    References: <*******************************C@LocalDomain>
    MIME-Version: 1.0
    X-KeepSent: ****************************; name=$KeepSent; type=4
    X-Mailer: Lotus Notes Release 8.5.2FP3 July 11, 2011
    X-Disclaimed: 54023
    Return-Path: [email protected]
    X-OriginalArrivalTime: 20 Mar 2015 10:43:03.0590 (UTC) FILETIME=[A48E9C60:01D062FA]
    --=_related **********************=
    Content-Type: multipart/alternative; boundary="=_alternative &**************"
    --=_alternative ******************
    Content-Type: text/plain; charset="KOI8-R"
    Content-Transfer-Encoding: base64
    U29tZXRoaW5nIHdyb25nLCBzb21ldGhpbmcgcmlnaHQsIHNvbWV0aGluZyBtaXNzaW5nDQpTb21l
    dGhpbmcgYmxhY2ssIHNvbWV0aGluZyBsaWdodCwgc29tZXRoaW5nIGRpZmZlcmVudA0KRG9uJ3Qg
    eW91IGV2ZXIgZmVlbCB5b3UgbmVlZCB0byBzcGVhayB0byBtZSB0aGF0IHdheT8NClNvbWV0aGlu
    ZyBibGFjaywgc29tZXRoaW5nIGxpZ2h0LCBzb21ldGhpbmcgZGlmZmVyZW50DQpTb21ldGhpbmcg
    d3JvbmcsIHNvbWV0aGluZyByaWdodCwgc29tZXRoaW5nIG1pc3NpbmcNCkRvbid0IHlvdSBldmVy
    IGZlZWwgeW91IG5lZWQgdG8gc3BlYWsgdG8gbWUgdGhhdCB3YXk/IA==--=_alternative ******************
    Content-Type: text/plain; charset="KOI8-R"
    Content-Transfer-Encoding: base64
    Because position of lines changes due to email type, as output I want to get:
    1). index of line that contains: Subject, i.e. "Subject: Incident ID#: 117 Something wrong, something right, something missing"
    2). index of line that contains "From", i.e. "From: [email protected]"
    3). base64 - decoded text (body of email)
    Thanks for your help.
    Have a nice day.

    jrv,
    your script, unfortunately, always return "String not found".
    Because you file is probably not constructed the same as the copy you posted.  I was just showing you how.  You will need to adjust to the actual file.
    Outlook can open and convert  EML files. 
    ¯\_(ツ)_/¯

  • Parsing text file using powershell

    Hi
    I am trying to extract
    ONLY the IP addresses in a DNS log file.  There are different IP addresses in the file. I managed to extract some data but that depends on the pattern that I am supplying, see command below
    Select-String -Path .\dns.log "snd*" | %{$_.line.split()} | Select-String "192.*"| Select-Object -Unique
    Select-String -Path .\dns.log "snd*" | %{$_.line.split()} | Select-String "10.*"| Select-Object -Unique
    any help would be appreciated
    mjksgea

    Hi
    there is an error with the word path.  removing it and running the script i get nothing, so I presume the $pattern needs changing, I am not familair with regex.
    A sample of the file
    09/04/2015 16:45:46 0574 PACKET  00000000055FFC60 UDP Rcv 10.10.30.21    f37b   Q [0001   D   NOERROR] A      (8)servername(5)Xsomthing(2)somthing(2)com(0)
    regards

  • Create SSIS Import parsing based on text file...

    I have a text file listing 500 field names and their lengths.  (In a few months we will begin receiving monthly data files matching that schema). I can create an SSIS 2008 project and manually parse the columns (inside SSIS)  to match that
    schema but I wonder if there is an easier way to do what I want (e.g. if I created a table using t-sql commands could SSIS somehow "pickup" the SSIS parsing from the table schema?)
    TIA,
    edm2

    Not exactly. What I was hoping for is that instead of pointing SSIS to the data file and manually parsing all the fields that  I could create an (empty) table with the right schema and have SSIS use that table schema to define how it should
    parse the input data. (Kind of backwards from the usual approach.)
    edm2
    Sorry you cant parse text file for metadata like that as metadata has to fixed in SSIS
    However one way you can implement this is as follows
    1. Create your table with required schema
    2. In SSIS have a data flow task with flat file source which points to your file. Choose only a row delimiter and no column delimiter
    3. Put a oledb destination and point to staging table with an identity column
    4. Put a Execute SQL Task  with query as below
    SELECT CASE WHEN (SELECT Column FROM Staging WHERE IDCol=1) = STUFF((SELECT ',' + COLUMN_NAME
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = 'Your schema table name'
    AND TABLE_SCHEMA = 'dbo'
    FOR XML PATH('')),1,1,'')
    THEN 0
    ELSE 1
    END AS SchemaDiff
    FROM (SELECT 1)t
    Then map SchemaDiff column in the resultset to a boolean variable created in ssis. Also make sure you set resultset option to single row
    Then you can use this boolean variable to check if schema is same. If False means no difference in schema else there's difference.
    just a caution thar this will only compare column details without comparing their datatypes,lengths etc
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Using a scanner to parse a text file

    Hi,
    I'm running into some difficulties using a pattern for my scanner (java.util.Scanner). I need to scan a text file which consists of records. Each record has a keyword and a value (like property files):
    Example:
    FACILITY=TEST
    LOT=1234567
    DEVICE=abcdefgNormally, every record will be ended by a carriage return and line feed. So what I did was using a scanner with cr/lf as delimiter. That worked fine for most records but there are some records which span several lines (with cr/lf at the end of each line), e.g.:
    MAP_XY.01.01=" Y-7 24/10 Y-6 24 22/17 15/7 Y-5 29/7 5 Y-4 32/22 20
    19/15 13/4 Y-3 34/24 22/13 11/2 Y-2 36/30 28/24 22
    21/12 10/4 2/0 Y-1 38/0 Y0 40/35 33/22 20/15 13/0 Y1 41
    40/32 30/8 6/-1 Y2 42/26 24/-2 Y3 42/-5 Y4 47/11 9
    8/3 1/-6 Y5 48/47 45/39 37/18 16/-7 Y6 49/8 6/-8 Y7 49
    47/8 6/4 2/-8 Y8 50/9 7/3 1/-9 Y9 51/11 9/-10 Y10 51
    50/33 31/-10 Y11 52/40 38/35 33/23 21/16 14/-11 Y12 52
    51/34 32/15 13/4 2/-11 Y13 53/40 38/35 33/-12 Y14 53
    52/35 33/27 25/18 16/13 11/9 7 5 2/0 -4/-12 Y15 53
    52/-12 Y16 53/22 20/-5 -7/-13 Y17 54/47 45/-7 -9/-13 Y18 54
    53/22 20 18/2 0/-13 Y19 55/16 14/13 11/-2 -4/-13 Y20 55
    53/41 39/35 33/-14 Y21 55/52 50/48 46/16 14/10 8/-2 -4
    -6/-14 Y22 54/33 31/7 5/4 2/0 -2/-9 -11/-13 Y23 55
    54/53 51/26 24/-2 -4/-13 Y24 55/15 13/-14 Y25 55 53
    52/-7 -9/-10 -12/-14 Y26 54/44 42/14 12/10 8/-4 -6
    -7/-10 -12/-13 Y27 55/52 50/23 20/16 14/-13 Y28 54
    53/12 10/-1 -3/-13 Y29 55/44 42/-13 Y30 55/15 13/10 8
    7/-13 Y31 55/17 15/-13 Y32 54/44 42/-1 -3/-13 Y33 54
    53/41 39/30 28/-13 Y34 54 52/37 35/19 17/12 9/8 5/3 1
    0/-4 -6 -9/-11 Y35 54/-13 Y36 54/35 33/31 29/13 11
    10/2 0/-2 -4/-13 Y37 54/-13 Y38 53/11 9/0 -2/-9 -11
    -12 Y39 53/35 33/31 29/-12 Y40 53/22 20/15 13/-12 Y41 52
    50/15 13/10 8/-11 Y42 52/11 9/5 3/-6 -8/-11 Y43 51
    50/41 39/10 8/0 -2/-10 Y44 51/28 26 24/15 13/12 10
    9/-10 Y45 50/43 41/32 30/4 2/-9 Y46 49/31 29/13 11
    10/-8 Y47 49/47 45/30 28/24 22/-8 Y48 48/42 40 38/12 10
    9/-7 Y49 47/42 40/38 36/-6 Y50 44/33 31/30 28/6 4/-5 Y51 44
    43/28 26/17 15/13 11/-2 Y52 44/32 30/-2 Y53 43/32 30
    29/13 11/-2 Y54 42/27 25/24 22/16 9 7/-1 Y55 41/21 19
    18/0 Y56 39/15 13/6 4 2 Y57 38/20 18/3 Y58 36/5 Y59 34
    33 31/30 28/7 Y60 31/28 26/10 Y61 27/14"
    BIN_COUNT.01.09=12345Using the following delimiter does not work
    fileScanner.useDelimiter("\\s*=\\s*");because the result would be something like:
    keyword: FACILITY     value: TEST
    LOTkeyword: 1234567
    DEVICE     value: abcdefgWhat I need is a pattern which also handles carriage return/line feed until a new keyword (like LOT for example) occurs.
    The correct result should be:
    keyword: FACILITY     value: TEST
    keyword: LOT            value: 1234567
    keyword: DEVICE     value: abcdefg
    keyword: MAP_XY.01.01 value: " Y-7 24/10 Y-6 24 22/17 15/7 Y-5 29/7 5 Y-4 32/22 20...
    {code}
    I hope, I did explain clearly enough...
    Any help would be appreciated.
    Thanks and best regards
    - Stephan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Any help would be appreciated.You have grouping and data in the groupings and you are attempting to parse it all at one go.
    Won't work. (Might in a perfect world but not in this one.)
    You need a parsers that do the following
    1. Parser text file (stream) into records.
    2. Parse records into data.
    You can put both into one class or not.
    Your record parser is going to be based roughly on the following scheme.
    1. Find keyword,
    2. Look up format defined for keyword
    3. Attempt to read format found.
    4. Error if format not found.
    5. Else return the record found.
    I say roughly because as noted above you need to know what the actual output looks like. It is possible to determine this if you have enough examples but it is a lot easier if you actually get the specification that tells you what it looks like.
    I suspect, but don't know that the "format" in the above will consist of the following.
    <word><text>
    or
    <word><text>
    <space><text>
    <space><text>
    You could just create one format for the all but you will likely have record types that don't fit that and the earlier you detect errors the better.

  • How to parse data from a text file with no convenient delimiters?

    I need to read data from a text file.  This file contains one line of data with the repeating pattern "time 00 ADVar2: ___ Height: ____ time 01 ADVar2: ___ Height: ___ ..."  I need LabView to parse out the "time" and "height" values, build an array with the values, and graph the correlation on an X&Y plot.  Does Labview have an automated way to read to the input data file and parse out the correct values, even without convenient delimiters?  Thank you.

    You actually do have a convenient delimiter: "time". Thus, you can make an array using that as the delimiter. Only caveat is that the first array element will be empty. Then you can conveniently use the Scan From String function in a for-loop. Something like this:
    Message Edited by smercurio_fc on 11-21-2008 03:13 PM
    Attachments:
    Example_VI.png ‏9 KB

  • VBScript for parsing multiple text files

    Hi,
    I have around 175 text files that contain inventory information that I am trying to parse into an Excel file. We are upgrading our Office platform from 2003 to 2010 and my boss wants to know which machines will have trouble supporting it. I found a script
    that will parse a single text file based upon ":" as the delimiter and I'm having trouble figuring out how to change it to open an entire folder of text files and write all of the data to a single Excel spreadsheet. Here is an example of the text
    file I'll be parsing. I'm interested in the "Memory and Processor Information" and "Disk Drive Information" sections mainly.
    ABEHRENS-XP Computer Inventory
    OS Information
    OS Details
    Caption: Microsoft Windows XP Professional
    Description:
    InstallDate: 20070404123855.000000-240
    Name: Microsoft Windows XP Professional|C:\WINDOWS|\Device\Harddisk0\Partition1
    Organization: Your Mom
    OSProductSuite:
    RegisteredUser: Bob
    SerialNumber: 55274-640-3763826-23029
    ServicePackMajorVersion: 3
    ServicePackMinorVersion: 0
    Version: 5.1.2600
    WindowsDirectory: C:\WINDOWS
    Memory and Processor Information
    504MB Total memory HOW CAN I PULL THIS WITHOUT ":" ALSO
    Computer Model: HP d330 uT(DG291A)
    Processor:               Intel(R) Pentium(R) 4 CPU 2.66GHz
    Disk Drive Information
    27712MB Free Disk Space ANY WAY TO PULL THIS WITHOUT ":"
    38162MB Total Disk Space
    Installed Software
    Here is the start of the script I have so far. . .
    Const ForReading = 1
    Set objDict = CreateObject("Scripting.Dictionary")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.OpenTextFile("C:\Test\test.txt" ,ForReading)
    WANT THIS TO BE C:\Test
    Do Until objTextFile.AtEndOfStream
    strLine = objTextFile.ReadLine
    If Instr(strLine,":") Then
    arrSplit = Split(strLine,":") IS ":" THE BEST DELIMITER TO USE?
    strField = arrSplit(0)
    strValue = arrSplit(1)
    If Not objDict.Exists(strField) Then
    objDict.Add strField,strValue
    Else
    objDict.Item(strField) = objDict.Item(strField) & "||" & strValue
    End If
    End If
    Loop
    objTextFile.Close
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Visible = True
    objExcel.Workbooks.Add
    intColumn = 1
    For Each strItem In objDict.Keys
    objExcel.Cells(1,intColumn) = strItem
    intColumn = intColumn + 1
    Next
    intColumn = 1
    For Each strItem In objDict.Items
    arrValues = Split(strItem,"||")
    intRow = 1
    For Each strValue In arrValues
    intRow = intRow + 1
    objExcel.Cells(intRow,intColumn) = strValue
    Next
    intColumn = intColumn + 1
    Next
    Thank you for any help.

    You are The Bomb.com! I had to play around with it to pull some additional data (model and processor) and then write a quick macro to remove the unwanted text and finally I wanted the data to write in columns instead of rows so this is what I ended up with:
    Option Explicit
    Dim objFSO, objFolder, strFolder, objFile
    Dim objReadFile, strLine, objExcel, objSheet
    Dim intCol, strExcelPath
    Const ForReading = 1
    strFolder = "c:\Test"
    strExcelPath = "c:\Test\Inventory.xlsx"
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Workbooks.Add
    Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
    intCol = 0
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(strFolder)
    For Each objFile In objFolder.Files
      intCol = intCol + 1
      Set objReadFile = objFSO.OpenTextFile(objFile.Path, ForReading)
      Do Until objReadFile.AtEndOfStream
        strLine = objReadFile.ReadLine
        If (InStr(strLine, "Computer Inventory") > 0) Then
          objSheet.Cells(intCol, 1).Value = Left(strLine, InStr(strLine, "Computer Inventory") - 2)
        End If
        If (InStr(strLine, "Total memory") > 0) Then
          objSheet.Cells(intCol, 2).Value = Left(strLine, InStr(strLine, "Total memory") - 2)
        End If
        If (InStr(strLine, "Computer Model:") > 0) Then
          objSheet.Cells(intCol, 3).Value = (strLine)
        End If
        If (InStr(strLine, "Processor:") > 0) Then
          objSheet.Cells(intCol, 4).Value = (strLine)
        End If
        If (InStr(strLine, "Total Disk Space") > 0) Then
          objSheet.Cells(intCol, 5).Value = Left(strLine, InStr(strLine, "Total Disk Space") - 2)
        End If
        If (InStr(strLine, "Free Disk Space") > 0) Then
          objSheet.Cells(intCol, 6).Value = Left(strLine, InStr(strLine, "Free Disk Space") - 2)
        End If
      Loop
    Next
    objExcel.ActiveWorkbook.SaveAs strExcelPath
    objExcel.ActiveWorkbook.Close
    objExcel.Quit
    Thanks again!
    Hi ,
    I am have very basic knowledge about VB scripting, but this code could be the perfect solution i am looking for. could you guide me exactly how to run and test the same , i would be really thankful for your kind and generous support on this.
    Thanks ,
    Veer

  • Parse from a text file

    Is there a way where i can parse a method, or conditional statement from a text file? Like lets say that i had the statement in Test.txt
    if(X >= Y)
    do something
    }and X and Y are already defined in the java file, is there a way that i could parse it so that the java code invokes it, as if it were part of the java file?

    Here's a little Groovy demo:
    import groovy.lang.GroovyShell;
    * To run this demo,
    *  - download 'groovy-binary-1.5.5.zip': http://dist.groovy.codehaus.org/distributions/groovy-binary-1.5.5.zip
    *  - unzip, and add 'lib/groovy-all-1.5.5.jar' to your classpath
    public class GroovyDemo {
        public static void main(String[] args) throws Exception {
            String script =
                " if(X > Y) {  \n"+
                "   return X+X \n"+
                " } else {     \n"+
                "   return Y/4 \n"+
                " }            \n";
            System.out.println("script=\n"+script);
            GroovyShell shell = new GroovyShell();
            shell.setProperty("X", new Integer(10));
            shell.setProperty("Y", new Integer(9));
            Object value = shell.evaluate(script);
            System.out.println("value="+value+", "+value.getClass());
            shell.setProperty("X", new Integer(8));
            value = shell.evaluate(script);
            System.out.println("value="+value+", "+value.getClass());
    /* output:
        script=
         if(X > Y) { 
           return X+X
         } else {    
           return Y/4
        value=20, class java.lang.Integer
        value=2.25, class java.math.BigDecimal
    */

Maybe you are looking for

  • File.delete() and File.deleteOnExit() doesn't work consistently..

    I am seeing some odd behavior with trying to delete files that were opened. Usually just doing new File("file.txt").delete() would work. However, in this case, I have created an input stream to the file, read it in, saved it to another location (copi

  • How to implement a static field with more then one value?

    Hello! I'm a novice at swing programming. Please help me to implement a static list like this: Field_1: Value; Field_2: Value_1;               Value_2;               Value_3; Field_3: Value; Field_4: Value; Values for each field can be added dynamicl

  • How to make a live curve in photoshop.

    Hi everyone, I just posted a video on youtube showing how to make a live curve. You can check it out here How to make a Live Curve in Photoshop - YouTube I'm very curious about your opinions:)

  • IPad has incorrect apple I'd. How do you change it?

    iPad is trying to use Wong apple ID in iTunes store. How do you change it?

  • Accordian Panels: want all CLOSED

    The Accordian panels I've installed are lower down in the page body, just high enough to begin to see without scrolling down.  Would like visitors to immediately see there's a list of topics - having the first panel open to start with, defeats that g