• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

.txt or CSV file to Database

Explorer ,
Jan 12, 2015 Jan 12, 2015

Copy link to clipboard

Copied

Hi-

I have a text file generated by a Pulse Oximeter, What I want is, as the system recieves the file (in .txt of CSV) it automaticly is entered into a MySql Database or SQL Server and generates an SMS message. Thanks

Regards

Tayyab Hussain

Views

470

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 18, 2015 Jan 18, 2015

Web services imply using sychronous communication. However, the use case you describe implies that asynchronous, so-called fire-and-forget, communication is better suited to your needs.

For example, with sychronous communication, the system is unaware of the exact moment a TXT or CSV file will come in. Also, when the system is processing a file, all other processing waits until the system finishes. This may cause synchronicity problems if multiple files come into the system in quick succession.

C

...

Votes

Translate

Translate
Advocate ,
Jan 12, 2015 Jan 12, 2015

Copy link to clipboard

Copied

This sounds more like design requirements for an application than a question. If the question is "can CF do this type of stuff?", definitely. If the question is "is there a build in tag for doing this sort of stuff?", no. If the former is your question, I have used a custom tag from the CF community library with success -- but my experience in this area in from the CF5 days and now there are build in tags like CFSPREADSHEET that probably does the parsing you need. Once parse in a CF usable format then you can put in in any database you want.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 14, 2015 Jan 14, 2015

Copy link to clipboard

Copied

Basiclly what I need is any Web Service or RESTful Service that can import the CVS or TXT file to any database server,(MySQL or MS SQl Server,etc), Secondly Any Idea, that how will application recognise that the database has been updated, with the new entry on runtime, (eg. if a webpage is active or say being browsed it can be refreshed,how can the Application be refreshed) If these two events are successful sending SMS is no issue. I hope I'am able to clear my point.

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 18, 2015 Jan 18, 2015

Copy link to clipboard

Copied

Web services imply using sychronous communication. However, the use case you describe implies that asynchronous, so-called fire-and-forget, communication is better suited to your needs.

For example, with sychronous communication, the system is unaware of the exact moment a TXT or CSV file will come in. Also, when the system is processing a file, all other processing waits until the system finishes. This may cause synchronicity problems if multiple files come into the system in quick succession.

ColdFusion has an asynchronous solution that suits every requirement of your use case. The following methods will enable you to receive the file, to automatically enter it into the database and to generate an SMS message. Use ColdFusion's DirectoryWatcher gateway to monitor the directory in which the TXT or CSV files are dropped, and ColdFusion's SMS event gateway to send SMS messages.

Whenever a third party drops a file into the directory, an event is triggered, setting the DirectoryWatcher into action. Implement a query in the onAdd method of the DirectoryWatcher's listener CFC to store the file in the database.  Following the query, use the sendGatewayMessage method to send the SMS message.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 21, 2015 Jan 21, 2015

Copy link to clipboard

Copied

LATEST

Dear BKBK,

Thanks for the help, I tried what you suggested, and it worked fine. Thanks again

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation