Professional Web Applications Themes

text file - Coldfusion - Advanced Techniques

I have the text file and I can be open in excel file. I guess it may be a tab delimiter file. I can save it into excel format and then export into SQL. However, I want able to read directly from text file and insert into SQL but don?t know how but don?t know how. Please help. Thanks...

  1. #1

    Default text file

    I have the text file and I can be open in excel file. I guess it may be a tab
    delimiter file. I can save it into excel format and then export into SQL.
    However, I want able to read directly from text file and insert into SQL but
    don?t know how but don?t know how. Please help.

    Thanks

    kt03 Guest

  2. #2

    Default Re: text file

    There may be better ways, but what I find easiest is to use cffile to read the
    file and cfhttp to turn it into a query. Queries are easy to work with.

    By the way, if the file is big, your application will be slow because you have
    to do a loop and insert each record individually. Cold Fusion should be your
    last resort, not your first choice.

    Originally posted by: kt03
    I have the text file and I can be open in excel file. I guess it may be a tab
    delimiter file. I can save it into excel format and then export into SQL.
    However, I want able to read directly from text file and insert into SQL but
    don?t know how but don?t know how to p the text file, Please help.

    Thanks



    Dan Guest

  3. #3

    Default Re: text file

    How do I do the cfhttp to turn it into a query? Can you be more specific or some demo ?

    Thanks
    kt03 Guest

  4. #4

    Default Re: text file

    kt03,

    Using cfhttp usually means placing your text file in a publically accessible
    location. So it is not always the best choice. As Dan mentioned, there are
    usually more efficient methods for importing text files. Most databases
    provide tools that allow you to load data from a text file into the database.
    What database are you using? For example, SQL Server has options like DTS,
    OPENROWSET, linked servers, etc.



    mxstu Guest

  5. #5

    Default Re: text file

    I forget the details, but I know they are in the cfml reference manual. If you
    don't have one, the internet does.

    Originally posted by: kt03
    How do I do the cfhttp to turn it into a query? Can you be more specific or
    some demo ?

    Here what I have but it didn't work

    <CFHTTP url="http://files/ex.txt" method="GET" name="rept"
    textqualifier='"' delimiter=","
    columns="Name
    ,State
    ,Updated
    ,Reference,
    Activation
    "
    resolveurl="false" timeout="90">


    Thanks



    Dan Guest

Similar Threads

  1. text field including text from a text file *.txt
    By Bernd Bach in forum Macromedia Flash
    Replies: 0
    Last Post: April 13th, 09:37 AM
  2. Load Text from Text file with html links?
    By Brajeshwar in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: January 13th, 12:09 AM
  3. Field Text vx Regular Text File Size
    By Tom Doyle in forum Macromedia Director Basics
    Replies: 1
    Last Post: September 3rd, 09:56 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139