Highlighted

.txt or CSV file to Database

Explorer ,
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

Adobe Community Professional
Correct answer by BKBK | Adobe Community Professional

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.

Views

308

Likes

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

.txt or CSV file to Database

Explorer ,
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

Adobe Community Professional
Correct answer by BKBK | Adobe Community Professional

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.

Views

309

Likes

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
Jan 12, 2015 0
Advocate ,
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.

Likes

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
Reply
Loading...
Jan 12, 2015 0
Explorer ,
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

Likes

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
Reply
Loading...
Jan 14, 2015 0
Adobe Community Professional ,
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.

Likes

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
Reply
Loading...
Jan 18, 2015 0
Explorer ,
Jan 21, 2015

Copy link to clipboard

Copied

Dear BKBK,

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

Likes

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
Reply
Loading...
Jan 21, 2015 0