external data capture

Using the Java SDK with TextPad

Moderators: AmigoJack, helios, bbadmin, Bob Hansen, MudGuard

Post Reply
Alessia
Posts: 2
Joined: Tue Feb 16, 2010 9:22 am

external data capture

Post by Alessia »

Hi everybody,
I need to capture a portion of an external .xml file. How can I do? Wich is the function that I need to use?
Thanks,
Alessia
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

It sounds like you are looking for a RegEx string.

If you can provide a before and after sample we can be of more help. Show part of the source file and show what you are trying to capture. Be sure to explain/show all variations such as variable letters vs digits, string lengths, etc.
Hope this was helpful.............good luck,
Bob
Alessia
Posts: 2
Joined: Tue Feb 16, 2010 9:22 am

Post by Alessia »

Spot Beam ID Coded Vertex Vertex/360 Decode Vertex
Latitude Longitude
1 24538 68.16111111 -22 -122
2 27061 75.16944444 -15 -119
3 29943 83.175 -7 -117
4 32463 90.175 0 -117
5 34983 97.175 7 -117

This is part of my imput, an Excel file, or eventually an xml file. I need to read these values and give them to a Java code to automate a process that is generating sensors with conic shape where the center of the circle of the conic has the latitude and longitude written above in the decode vertex. I need to transfer these data to another software (STK, that create sensor object) that can communicate with Java; so Java is the way to automate this process. I am not an expert of Java and I hope that you can understand what I should do. Let me know if you need more informations to help me.
Thanks,
Alessia.
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

I am not a Java expert, but it sounds like you need to create script to do something like this:

Code: Select all

Set line counter to 0

Start loop
Increase line counter by 1
Read next Data Source file line (same as line counter)
Use RegEx to extract the value to a variable
Write the extracted value variable to STK program
Check for EOF.
If EOF then exit, else 
Jump to Start Loop again.
Hope this was helpful.............good luck,
Bob
Post Reply