I have some xml files that contain quite a lot of data, several hundred, and I would like to be able to extract 3 or 4 named tags from each xml file in a directory. I have a script that can do this but I am a bit confused as to how to execute this. ideally it would be best to have a development environment or other method to convert the script into an exe, but just being able to run the script would be a good start! cheers!
ldsdbomber
Posts
-
Help running php scripts locally and/or conversion to executable format -
Adding Data to datagridview [modified]Thanks. Of course, that is exactly what it was, I hadn't changed the file read section to allow the user to browse for an actual file location! doh! thanks for the heads up
-
Adding Data to datagridview [modified]do { iniText = iniStream.ReadLine(); // Skip comments started by \* character if(String.Compare(iniText.Substring(0,1),("\*")) == 0) continue; string \[\] dataItems = iniText.Split(new Char \[\] {','}); dataGridView1.Rows.Add(dataItems); } while (iniText != null);
When stepping through the code, dataItems correctly contains each array of comma separated variables, but the datagrid control is not being populated with the Rows.Add method. What am I missing? t.i.a OK, I changed it to this
do { iniText = iniStream.ReadLine(); if (iniText == null) continue; // Skip comments started by \* character if(String.Compare(iniText.Substring(0,1),("\*")) == 0) continue; string \[\] dataItems = iniText.Split(new Char \[\] {','}); dataGridView1.Rows.Add(dataItems); } while (iniText != null);
obviously I need to rethink my loop logic. But when i step through in Debug with F5 it populates the control properly, when I run without debugging, it is still empty. Why does that happen?
modified on Wednesday, October 14, 2009 2:42 AM
-
what is ObjectSender and EventArgs in Windows FormSorry, what I meant was not a specific book, but a specific class of book. i.e. does a general purpose C# book contain details about controls and event handlers, or is that specific to windows forms etc. And for handling and tokenising strings and dialog data, are there specific types of books for that or... I realise this question is a bit wishy washy!
-
what is ObjectSender and EventArgs in Windows FormMany thanks. Do you have any opinions as to a good reference book that would include this kind of information, i.e do I want a book on C# itself, or is it Windows Forms, or Visual Studio specific?
-
what is ObjectSender and EventArgs in Windows FormIn a simple dialog namespace projectname { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void FormDataChanged(object sender, EventArgs e) { blah......... } private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { FormDataChanged(???????????, ?????????); } } } If I want to use the FormDataChanged function when I process the change in a listbox or a checkbox or whatever, what should I supply as the arguments. I suppose I have just dived in to C# and it's a bit different to what I am used to. I am not using either "sender" or "e" in the FormDataChanged function, I just want to know what is/should be in there, is it the item on the form itself that is the object, e.g. in the example above, is it the listbox itself, should it be "this" as the 1st parameter, and where does its EventArgs come from? thanks for any help If I put FormDataChanged(sender, e) that seems like it should be correct, but maybe I just need to find out a bit more about how the sender/args constructs work in more detail
-
Problem with #defined valuesThe answer of course is, yes, I was doing something incredibly stupid. I really ought to try the count to 10 rule before posting :-) unsurprisingly, sprintf_s( eBuff, 16, "%.0f", energyTable[ETABLESIZE*sel + NOMINDEX] ); works rather better, since energyTable is a float array DOH! sorry.....
-
Problem with #defined valuesIn a header file I have #define NOMINDEX 0 ... #define ETABLESIZE 5 In the source file that includes this header, the following doesn't seem to work (it's writing 0 to the buffer (and in the watch window in VS, it's saying it doesn't recognise the symbols defined) sprintf_s( eBuff, 16, "%d", energyTable[ETABLESIZE*sel + NOMINDEX] ); if I add this line before it, "e" is correctly assigned to 5 int e = ETABLESIZE; sprintf_s( eBuff, 16, "%d", energyTable[ETABLESIZE*sel + NOMINDEX] ); In other parts of my cpp file I use these constants and they seem to work correctly. Have I done something incredibly stupid? cheers Lee
-
Line Number macros to use in output of Message Box?I'd like to configure MessageBox(myMsg, myTitle, MB_OK); so that myMsg contains the line number of the source file, I've already made it include the source file name, function and explanation, but it would be useful to be able to have it include the current line number using a macro in Visual Studio ? (I'm on ver 2005) so that as I change the source, the line number is always reported correctly during program execution tks if you can help Lee
-
Continued Problems with VS2005 and MFC with VistaHi, I cannot get VS2005 to work properly on my Vista when I use the dialog app wizard, nothing happens - I have the Sp1 update etc installed for VS. Can someone tell me if there is a workaround for me to get the files the wizard would create, including a blank resource template that I can visually drag and drop controls onto, and if there are still any issues with linking controls to code as I've seen before (I've not had VS installed for ages, and only previously on XP). Would these issues go away on an XP based system. thanks for any help cheers Lee
-
Recommendations for language and IDEI understand that, but probably if it was that serious I'd mention it :-) The fact that it is "simple dialog apps" is a bit of a clue though, it's generally data analysis type things base on the MFC dialog app wizard - so, no, nothing fancy, though on occasion it's data that will be used in a clinical situation so accuracy is sometimes very important in terms of calculations and data flow.
-
Recommendations for language and IDEWell I thought I had provided you with that information. I'm not writing full scale projects, mainly dialog based apps for my own amusement, but with a view at some point to also writing similar tools and utilities for work. As I've not really been "in" the field for a while, now was a good time to get an update as to whether that kind of thing is better done now in the new technology or not
-
"Rules" for vista coding?Is there anything other than this http://www.codeproject.com/KB/vista/Certified\_for\_Vista.aspx to explain in laymans terms, perhaps a brief overview of things to look out for when coding in Vista, that you might not have worried about with XP, I know for example that you can no longer write to the registry like you could before
-
Recommendations for language and IDEopinions are fine :-) and thanks for yours. I'm sure I did install some kind of 'patch' for Vista but remember that it didn't seem to fix all my issues relating to adding control variables to controls and things like that. I've seen there is a 430 MB VS 2005 SP1 Team Update(what????) and a Vista SP1 Update at 29MB, not sure if they are both part of the same process, I'll see if I can find what it was I installed when i first got the laptop, probably summertime 2007. cheers!
-
Recommendations for language and IDEI'm going to start getting back "into" some coding again after a hiatus (actually it's a fairly long one, though I did briefly do some stuff for work here). I've always used Visual Studio 6 and C++/MFC. I have a new vista laptop and even after the patches, found that my shiny new VS 2005 that work bought for me doesn't always work properly when writing simple dialog apps with controls. On the whole, that's the kind of thing I would like to do a lot of, though I will try out "proper" MDI applications at some point. My point is this - I see a lot written now about .NET and C#, am I better off looking at that and learning those from scratch, or should I just refresh and improve my knowledge with C++/MFC in particular. These won't likely be "hardcore" industrial apps, but I would like to write things that are a bit more robust at some point. I think at work they might well get an old VS installed at some point, maybe even v6, but at home, it seems a shame that I'm a bit suspicious of VS2005 which is newer of course. Basically, any advice would be welcome, this isn't spam or trying to get controversy or arguments, nor do I really need any cryptic replies like "use what you feel most comfortable with". I'm at a point where I really can think about where to invest a bit of time and self learning and start playing around. If someone can tell me about other IDE's or perhaps quell my fears about VS2005 in Vista (I even read that you need Vista Business - not sure which I have, but I don't have the most expensive version, nor the cheapest) then perhaps I'm Ok just carrying on with simple dialog apps in MFC for now, but am I missing the boat here, is C# and .NET taking over?
-
How to correctly trap "Enter" key in MFC dialog ?which is fine, I've now stopped OnOk from closing the diagram thanks chaps!
-
How to correctly trap "Enter" key in MFC dialog ?OK, removing the "default button" style now works, but NOW it closes the dialog, even though I have overridden the OnOk and OnCancel functions.
-
How to correctly trap "Enter" key in MFC dialog ?I've tried it with (by setting the "want return" style in the visual dialog editor) and without (which is was before). same result!
-
How to correctly trap "Enter" key in MFC dialog ?no, it's not exiting, it's acting like a button is being pressed. the edit control is Tab oRder 5, contains a number, there is another numeric edit at tab order 6, then tab order 7 is a button which adds some calculated data to a listview report. hitting enter after the data in edit box 5 is causing the data to be added to the table. Is there any way I can track what's causing this?
-
How to correctly trap "Enter" key in MFC dialog ?thanks, I have OnOk and OnCancel managed manually, and my program correctly exits via the red X button on the title bar, and through File->Exit my problem is not that the dialog is closing but that pressing the Enter key while in an edit control is somehow activating a press of another button thats adding that data to a listview elsewhere. Since the user is typing into the edit control, I assumed the focus was there, so don't understand how that is turning into the same action as pressing this other button (that is not at the top of the tab order tree, so it's not like it's defaulting to that)