473,385 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Read data from file, send via HTTP form

I'm trying to write an interface to send scoreboard data from an XML
file generated by a football stats program to a Chyron CODi character
generator connected to my COM1 serial port (all operations on same
machine). I'm already able to send static commands written into HTTP
forms to control the CG via serial COM1.

What I'm needing is a way to read and parse variables from the XML,
then generate a CODi command string which can be written to the page as
the value of a hidden form INPUT attribute.

Some of the XML variables are free standing and require no parsing, but
the stats program writes <downtogo context="V,1,10,H10"> to represent
"possFlag,down,togo,ballOn".

"possFlag" will have to be logically parsed (if possFlag = "V" then
vPoss = "1", hPoss = ""; if possFlag = "H" then hPoss = "1", vPoss =
""), "down" will have to be parsed into an ordinal ("1st", "2nd",
"3rd", 4th", 5="OT") and "togo" simply has to be extracted 'as-is'.

For reference, CODi command string syntax for this display is:

\DB\2\R\022\230\230\230\0\032\230\230\230\0\\\TU\1 \Fox14\2\"vID"
"vPoss"\3\"vScore"\4\"hID" "hPoss"\5\"hScore"\6\"qtr"st Qtr\7\"down" &
"togo"\\

Since I'm not sending clock data to the CG on a realtime basis, I can
refresh the page after each play and send the CG command manually.

Although I've been playing with javascripts for more than 7 years, I
still consider myself a beginner. Thanks in advance for any help you
can offer.

Jim O'Malley / Station Manager / Fox14 Amarillo

Jun 15 '06 #1
1 2162

ji*********@image66amarillo.com wrote:
What I'm needing is a way to read and parse variables from the XML,
then generate a CODi command string which can be written to the page as
the value of a hidden form INPUT attribute.

Well, you will have a lot of switch statements and concatenation.
Other than that, you will just have hours of testing / debugging.
There doesn't seem to be any special trick, just a lot of string
comparisons. For more powerful comparisons, look up replace() and
regular expressions.

How much are you willing to pay for it? ;)

Jun 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Nik Coughin | last post by:
Is there a simple way of opening a text file from a server, and reading from it line by line? IE http://someserver/file.txt contains a couple of hundred lines. Each line is the name of a...
4
by: Kurien Baker Fenn | last post by:
How to send data from an ASP form to a visual basic form? Please help
10
by: Noozer | last post by:
Below is some ASP, HTML and javascript. It is part of a page used to maintain a small database. This code did work at one time, but has since stopped. For some reason the data on my form is not...
18
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE)...
4
by: supster | last post by:
Hello, I am trying to use HttpWebRequest to simulate sending some POST data from a form to a PHP script. I have accomplished this using: HttpWebRequest req = (HttpWebRequest)...
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
1
by: Jason Ho | last post by:
Hi, I would like to send a jpg file to a HTTP server by POST request. But I am not using a browser to do this, I use a Windows Form instead. I know how to send typical request by POST with code...
6
by: juky | last post by:
Hi all, I have 2 applications one in VB.net and the other in VC6. I need to pass data between them. How can I do it? what's the best way to implement such communication ? Any comment will be...
1
by: mulham.haffar | last post by:
hi guys.. im writing an application that uses windows service to listen (as a tcplistener) for any data sent (by a tcpclient) ... one kind of the requests might be a file sent by client and the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.