Search Results

Search found 3176 results on 128 pages for 'parsing'.

Page 15/128 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • .BAT Switches Parsing

    - by giiYanJ
    Erm.. I'm working with a switches parsing in BAT files, which goes like this: <commands> -a -b -x -y -z -u abc ...... The user may input a lot of switch, or none. So I used looped shift to make parsing infinite switches possible: :loop IF "%1"=="-a" ... SHIFT GOTO loop But when the script ends, I always get cmd executing the switches and showing up error like '-n' is not recognized as an internal... So, someone got any idea? Thanks a lot... P/S: Make solution sticks with BAT script if possible as using other language may cause dependencies problem as this script is aimed on ANY computer with Windows. Finally, thanks again =) EDIT: Tried shf301 suggestion, i found out that I used DEL %0 to delete itself but it seems the %0 is shifted into the arguments because of the SHIFT command.

    Read the article

  • Problem with parsing XML with iPhone app

    - by zp26
    Hi, I have a problem with a xml parsing. I have create a class for parsing. The xmlURL is correct (testing it from debug) but when i call the method parse the variable success become FALSE and a errorParsing is "NSXMLParserErrorDomain". Can you help me? My code is below. #import "xmlParser.h" #import"Posizione.h" @implementation xmlParser @synthesize arrayPosizioniXML; NSString *tempString; Posizione *posizioneRilevata; - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { if([tempString isEqualToString:@"name"]) posizioneRilevata.nome = string; else if([tempString isEqualToString:@"x"]) posizioneRilevata.valueX = [string floatValue]; else if([tempString isEqualToString:@"y"]) posizioneRilevata.valueY = [string floatValue]; else if([tempString isEqualToString:@"z"]) posizioneRilevata.valueZ = [string floatValue]; else if([tempString isEqualToString:@"/posizione"]) [arrayPosizioniXML addObject:posizioneRilevata]; } - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { //[textArea setText:[[NSString alloc] initWithFormat:@"%@\nFine elemento: %@",textArea.text,elementName]]; } - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { if ([elementName isEqualToString:@"name"]){ tempString = @"name"; NSLog(@"ok"); } else if([elementName isEqualToString:@"x"]){ tempString = @"x"; } else if([elementName isEqualToString:@"y"]) { tempString = @"y"; } else if([elementName isEqualToString:@"z"]) { tempString = @"z"; } else if([elementName isEqualToString:@"/posizione"]) { tempString = @"/posizione"; } } -(BOOL)avviaParsing{ //Bisogna convertire il file in una NSURL altrimenti non funziona NSLog(@"zp26 %@",path); NSURL *xmlURL = [NSURL fileURLWithPath:path]; // Creiamo il parser NSXMLParser *parser = [[ NSXMLParser alloc] initWithContentsOfURL:xmlURL]; // Il delegato del parser e' la classe stessa (self) [parser setDelegate:self]; //Effettuiamo il parser BOOL success = [parser parse]; //controlliamo come è andata l'operazione if(success == YES){ //parsing corretto return TRUE; } else { NSError *errorParsing = [[NSError alloc]init]; errorParsing = [parser parserError]; //c'è stato qualche errore... return FALSE; } // Rilasciamo l'oggetto NSXMLParser [parser release]; } -(id)init { self = [super init]; if (self != nil) { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectoryPath = [paths objectAtIndex:0]; path = [documentsDirectoryPath stringByAppendingPathComponent:@"filePosizioni.xml"]; posizioneRilevata = [[Posizione alloc]init]; tempString = [[NSString alloc]init]; } return self; } @end @implementation AccelerometroViewController -(BOOL)caricamentoXML{ xmlParser *parser; parser = [[xmlParser alloc]init]; if([parser avviaParsing]){ [arrayPosizioni addObjectsFromArray:parser.arrayPosizioniXML]; return TRUE; } else return FALSE; } - (void)viewDidLoad { [super viewDidLoad]; if([self caricamentoXML]){ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Caricamento Posizioni da Xml" message:@"Posizione caricata con successo" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; [alert show]; [alert release]; } else{ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Caricamento Posizioni da Xml" message:@"Posizione non caricate" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; [alert show]; [alert release]; } } @end

    Read the article

  • HL7 parsing in PHP

    - by Narcissus
    Hi all, I'm looking into options for parsing HL7 messages via PHP. I'm aware of the Net_HL7 package on PEAR but to be perfectly honest, I don't think that I want to base my code around a seemingly 'abandoned' package and even if I did, I just don't think that my brain suits the functions 'correctly'. Maybe if I had more of an HL7 background it would make a bit more sense, I don't know. Anyway: I'm guessing that 95% of the time, I'm going to be parsing and reading data from messages. The other 5%, I'll be creating and/or sending messages. I don't necessarily need to do any form of validation on the messages themselves, I just need to pull/push data. I definitely need support for 'non-XML' HL7 v2.x, but naturally XML-based v2 and v3 would be a bonus. So does anyone have any suggestions as to other libraries that I might use? I'm looking for pure PHP solutions as I want to have minimal requirements on the server that aren't "copy this directory here". Thanks!

    Read the article

  • Confused with an ASP.NET/WCF WSDL Parsing Error

    - by Vaccano
    I have a WCF Web Service that my ASP.NET app uses. It has been working fine for quite some time. I just added in a Dev Express Grid (and the Dev Express DLLs) and a new page that uses them and now I am getting parsing errors on the WSDL. But the weird part is that it works fine on my machine but fails on the web server machine. (Both are connecting to the same web services WSDL.) Here is the error message I am getting: Server Error in '/MyWebAppWebDev' Application. -------------------------------------------------------------------------------- Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Reference.svcmap: Failed to generate code for the service reference 'MyWebAppService'. Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: Referenced type 'WebClientApp.MyWebAppService.ReferenceUpdatesDataContract, WebClientApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' with data contract name 'ReferenceUpdatesDataContract' in namespace 'http://schemas.datacontract.org/2004/07/MyWebAppServiceLibrary.DataContracts' cannot be used since it does not match imported DataContract. Need to exclude this type from referenced types. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IMyWebAppReferenceDataServiceLib'] Cannot import wsdl:binding Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on. XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IMyWebAppReferenceDataServiceLib'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='MyWebAppServicesDefaultEndpoint'] Cannot import wsdl:port Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='MyWebAppServicesDefaultEndpoint'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='MyWebAppReferenceDataServiceLib']/wsdl:port[@name='MyWebAppServicesDefaultEndpoint'] Source Error: [No relevant source lines] Source File: /MyWebAppWebDev/App_WebReferences/MyWebAppService/ Line: 1 I am completely stumped on this. I have checked my web.config endpoint address and it is spot on (and notably is not in the error message above). Any ideas would be welcomed.

    Read the article

  • Formula parsing / evaluation routine or library with generic DLookup functionality

    - by tbone
    I am writing a .Net application where I must support user-defined formulas that can perform basic mathematics, as well as accessing data from any arbitrary table in the database. I have the math part working, using JScript Eval(). What I haven't decided on is what a nice way is to do the generic table lookups. For example, I may have a formula something like: Column: BonusAmount Formula: {CurrentSalary} * 1.5 * {[SystemSettings][Value][SettingName=CorpBonus AND Year={Year}]} So, in this example I would replace {xxx} and {Year} with the value of Column xxx from the current table, and I would replace the second part with the value of (select Value from SystemSettings WHERE SettingName='CorpBonus' AND Year=2008) So, basically, I am looking for something very much like the MS Access DLookup function: DLookup ( expression, domain, [criteria] ) DLookup("[UnitPrice]", "Order Details", "OrderID = 10248") But, I also need to overall parsing routine that can tell whether to just look up in the current row, or to look into another table. Would also be nice to support aggregate functions (ie: DAvg, DMax, etc), as well as all the weird edge cases handled. So I wonder if anyone knows of any sort of an existing library, or has a nice routine that can handle this formula parsing and database lookup / aggregate function resolution requirements.

    Read the article

  • Trouble parsing quotes with SAX parser (javax.xml.parsers.SAXParser) on Android API 1.5

    - by johnrock
    When using a SAX parser, parsing fails when there is a " in the node content. How can I resolve this? Do I need to convert all " characters? In other words, anytime I have a quote in a node: <node>characters in node containing "quotes"</node> That node gets butchered into multiple character arrays when the Handler is parsing it. Is this normal behaviour? Why should quotes cause such a problem? Here is the code I am using: import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; ... HttpGet httpget = new HttpGet(GATEWAY_URL + "/"+ question.getId()); httpget.setHeader("User-Agent", PayloadService.userAgent); httpget.setHeader("Content-Type", "application/xml"); HttpResponse response = PayloadService.getHttpclient().execute(httpget); HttpEntity entity = response.getEntity(); if(entity != null) { SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); ConvoHandler convoHandler = new ConvoHandler(); xr.setContentHandler(convoHandler); xr.parse(new InputSource(entity.getContent())); entity.consumeContent(); messageList = convoHandler.getMessageList(); }

    Read the article

  • Optimising RSS parsing on App Engine to avoid high CPU warnings

    - by Danny Tuppeny
    I'm pulling some RSS feeds into a datastore in App Engine to serve up to an iPhone app. I use cron to schedule updating the RSS every x minutes. Each task only parses one RSS feed (which has 15-20 items). I frequently get warnings about high CPU usage in the App Engine dashboard, so I'm looking for ways to optimise my code. Currently, I use minidom (since it's already there on App Engine), but I suspect it's not very efficient! Here's the code: dom = minidom.parseString(urlfetch.fetch(url).content) if dom: items = [] for node in dom.getElementsByTagName('item'): item = RssItem( key_name = self.getText(node.getElementsByTagName('guid')[0].childNodes), title = self.getText(node.getElementsByTagName('title')[0].childNodes), description = self.getText(node.getElementsByTagName('description')[0].childNodes), modified = datetime.now(), link = self.getText(node.getElementsByTagName('link')[0].childNodes), categories = [self.getText(category.childNodes) for category in node.getElementsByTagName('category')] ); items.append(item); db.put(items); def getText(self, nodelist): rc = '' for node in nodelist: if node.nodeType == node.TEXT_NODE: rc = rc + node.data return rc There isn't much going on, but the scripts often take 2-6 seconds CPU time, which seems a bit excessive for looping through 20ish items and reading a few attributes. What can I do to make this faster? Is there anything particularly bad in the above code, or should I change to another way of parsing? Are there are any libraries (that work on App Engine) that would be better, or would I be better parsing the RSS myself?

    Read the article

  • Trouble parsing quotes with SAX parser (javax.xml.parsers.SAXParser)

    - by johnrock
    When using a SAX parser, parsing fails when there is a " in the node content. How can I resolve this? Do I need to convert all " characters? In other words, anytime I have a quote in a node: <node>characters in node containing "quotes"</node> That node gets butchered into multiple character arrays when the Handler is parsing it. Is this normal behaviour? Why should quotes cause such a problem? Here is the code I am using: import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; ... HttpGet httpget = new HttpGet(GATEWAY_URL + "/"+ question.getId()); httpget.setHeader("User-Agent", PayloadService.userAgent); httpget.setHeader("Content-Type", "application/xml"); HttpResponse response = PayloadService.getHttpclient().execute(httpget); HttpEntity entity = response.getEntity(); if(entity != null) { SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); ConvoHandler convoHandler = new ConvoHandler(); xr.setContentHandler(convoHandler); xr.parse(new InputSource(entity.getContent())); entity.consumeContent(); messageList = convoHandler.getMessageList(); }

    Read the article

  • Abort SAX parsing mid-document?

    - by CSharperWithJava
    I'm parsing a very simple XML schema with a SAX parser in Android. An example file would be <Lists> <List name="foo"> <Note title="note 1" .../> <Note title="note 2" .../> </List> <List name="bar"> <Note title="note 3" .../> </List> </Lists> The ... represents more note data as attributes that aren't important to question. I use a SAX parser to parse the document and only implement the startElement and 'endElement' methods of the HandlerBase to handle Note and List nodes. However, In some cases the files can be very large and take some time to process. I'd like to be able to abort the parsing process at any time (i.e. user presses cancel button). The best way I've come up with is to throw an exception from my startElement method when certain conditions are met (i.e. boolean stopParsing is true). Is there a better way to do this? I've always used DOM style parsers, so I don't fully understand the SAX parser. One final note, I'm running this on Android, so I will have the Parser running on a worker thread to keep the UI responsive. If you know how I can kill the thread safely while the parser is running that would answer my question as well.

    Read the article

  • Keeping the UI responsive while parsing a very large logfile

    - by Carlos
    I'm writing an app that parses a very large logfile, so that the user can see the contents in a treeview format. I've used a BackGroundWorker to read the file, and as it parses each message, I use a BeginInvoke to get the GUI thread to add a node to my treeview. Unfortunately, there's two issues: The treeview is unresponsive to clicks or scrolls while the file is being parsed. I would like users to be able to examine (ie expand) nodes while the file is parsing, so that they don't have to wait for the whole file to finish parsing. The treeview flickers each time a new node is added. Here's the code inside the form: private void btnChangeDir_Click(object sender, EventArgs e) { OpenFileDialog browser = new OpenFileDialog(); if (browser.ShowDialog() == DialogResult.OK) { tbSearchDir.Text = browser.FileName; BackgroundWorker bgw = new BackgroundWorker(); bgw.DoWork += (ob, evArgs) => ParseFile(tbSearchDir.Text); bgw.RunWorkerAsync(); } } private void ParseFile(string inputfile) { FileStream logFileStream = new FileStream(inputfile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); StreamReader LogsFile = new StreamReader(logFileStream); while (!LogsFile.EndOfStream) { string Msgtxt = LogsFile.ReadLine(); Message msg = new Message(Msgtxt.Substring(26)); //Reads the text into a class with appropriate members AddTreeViewNode(msg); } } private void AddTreeViewNode(Message msg) { TreeNode newNode = new TreeNode(msg.SeqNum); BeginInvoke(new Action(() => { treeView1.BeginUpdate(); treeView1.Nodes.Add(newNode); treeView1.EndUpdate(); Refresh(); } )); } What needs to be changed?

    Read the article

  • OO Objective-C design with XML parsing

    - by brainfsck
    Hi, I need to parse an XML record that represents a QuizQuestion. The "type" attribute tells the type of question. I then need to create an appropriate subclass of QuizQuestion based on the question type. The following code works ([auto]release statements omitted for clarity): QuizQuestion *question = [[QuizQuestion alloc] initWithXMLString:xml]; if( [ [question type] isEqualToString:@"multipleChoiceQuestion"] ) { [myQuestions addObject:[[MultipleChoiceQuizQuestion alloc] initWithXMLString:xml]; } //QuizQuestion.m -(id)initWithXMLString:(NSString*)xml { self.type = ...// parse "type" attribute from xml // parse the rest of the xml } //MultipleChoiceQuizQuestion.m -(id)initWithXMLString:(NSString*)xml { if( self= [super initWithXMLString:xml] ) { // multiple-choice stuff } } Of course, this means that the XML is parsed twice: once to find out the type of QuizQuestion, and once when the appropriate QuizQuestion is initialized. To prevent parsing the XML twice, I tried the following approach: // MultipleChoiceQuizQuestion.m -(id)initWithQuizRecord:(QuizQuestion*)record { self=record; // record has already parsed the "type" and other parameters // multiple-choice stuff } However, this fails due to the "self=record" assignment; whenever the MultipleChoiceQuizQuestion tries to call an instance-method, it tries to call the method on the QuizQuestion class instead. Can someone tell me the correct approach for parsing XML into the appropriate subclass when the parent class needs to be initialized to know which subclass is appropriate?

    Read the article

  • Parsing custom time format with SimpleDateFormat

    - by ggrigery
    I'm having trouble parsing a date format that I'm getting back from an API and that I have never seen (I believe is a custom format). An example of a date: /Date(1353447000000+0000)/ When I first encountered this format it didn't take me long to see that it was the time in milliseconds with a time zone offset. I'm having trouble extracting this date using SimpleDateFormat though. Here was my first attempt: String weirdDate = "/Date(1353447000000+0000)/"; SimpleDateFormat sdf = new SimpleDateFormat("'/Date('SSSSSSSSSSSSSZ')/'"); Date d1 = sdf.parse(weirdDate); System.out.println(d1.toString()); System.out.println(d1.getTime()); System.out.println(); Date d2 = new Date(Long.parseLong("1353447000000")); System.out.println(d2.toString()); System.out.println(d2.getTime()); And output: Tue Jan 06 22:51:41 EST 1970 532301760 Tue Nov 20 16:30:00 EST 2012 1353447000000 The date (and number of milliseconds parsed) is not even close and I haven't been able to figure out why. After some troubleshooting, I discovered that the way I'm trying to use SDF is clearly flawed. Example: String weirdDate = "1353447000000"; SimpleDateFormat sdf = new SimpleDateFormat("S"); Date d1 = sdf.parse(weirdDate); System.out.println(d1.toString()); System.out.println(d1.getTime()); And output: Wed Jan 07 03:51:41 EST 1970 550301760 I can't say I've ever tried to use SDF in this way to just parse a time in milliseconds because I would normally use Long.parseLong() and just pass it straight into new Date(long) (and in fact the solution I have in place right now is just a regular expression and parsing a long). I'm looking for a cleaner solution that I can easily extract this time in milliseconds with the timezone and quickly parse out into a date without the messy manual handling. Anyone have any ideas or that can spot the errors in my logic above? Help is much appreciated.

    Read the article

  • Trouble parsing self closing XML tags using SAX parser

    - by sandesh
    Hi, I am having trouble parsing self closing XML tags using SAX. I am trying to extract the link tag from the Google Base API.I am having reasonable success in parsing regular tags. Here is a snippet of the xml <entry> <id>http://www.google.com/base/feeds/snippets/15802191394735287303</id> <published>2010-04-05T11:00:00.000Z</published> <updated>2010-04-24T19:00:07.000Z</updated> <category scheme='http://base.google.com/categories/itemtypes' term='Products'/> <title type='text'>En-el1 Li-ion Battery+charger For Nikon Digital Camera</title> <link rel='alternate' type='text/html' href='http://rover.ebay.com/rover/1/711-67261-24966-0/2?ipn=psmain&amp;icep_vectorid=263602&amp;kwid=1&amp;mtid=691&amp;crlp=1_263602&amp;icep_item_id=170468125748&amp;itemid=170468125748'/> . . and so on I can parse the updates and published tags, but not the link and category tag. Here is my startElement and endElement overrides public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (qName.equals("title") && xmlTags.peek().equals("entry")) { insideEntryTitle = true; } xmlTags.push(qName); } public void endElement(String uri, String localName, String qName) throws SAXException { // If a "title" element is closed, we start a new line, to prepare // printing the new title. xmlTags.pop(); if (insideEntryTitle) { insideEntryTitle = false; System.out.println(); } } declaration for xmltags.. private Stack<String> xmlTags = new Stack<String>(); Any help guys? this is my first post here.. I hope I have followed posting rules! thanks a ton guys..

    Read the article

  • mod perl in apache 2.2 not parsing perl scripts

    - by futureelite7
    Hi, I've set up a fresh Apache 2.2.15 server on windows server 2008 R2 with mod_perl (mod perl v2.0.4 / perl v5.10.1). Mod_perl and Perl 5.10 has been installed and loaded without problems. However, despite my configuration, the mod_perl module is failing to recognize and execute my .pl file, instead opting to print out the perl source instead. What did I do wrong, and how do I make perl process my pl script instead of sending it to the client? My configuration: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "C:\Program Files (x86)\AWStats\wwwroot" ServerName analysis.example.com ServerAlias analysis.example.com ErrorLog "logs/analysis.example.com-error.log" CustomLog "logs/analysis.example.com-access.log" common DirectoryIndex index.php index.htm index.html PerlSwitches -T <Directory "C:\Program Files (x86)\AWStats\wwwroot"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> <Directory "C:\Program Files (x86)\AWStats\wwwroot\cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all <FilesMatch "\.pl$"> SetHandler perl-script # #PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI </FilesMatch> </directory> </VirtualHost> Many many thanks for the help!

    Read the article

  • Variable parsing with Bash and wget

    - by Bill Westrup
    I'm attempting to use wget in a simple bash script to grab a jpeg image from an Axis camera. This script outputs a file named JPEGOUT, instead of the desired output, which should be a timestamp jpeg (ex: 201209292040.jpg) . Changing the variable in the wget statement from JPEGOUT to $JPEGOUT makes wget fail with "wget: missing URL" error. The weird thing is wget parses the $IP vairable correctly. No luck on the output file name. I've tried single quotes, double quotes, parenthesis: all to no luck. Here's the script !/bin/bash IP=$1 JPEGOUT= date +%Y%m%d%H%M.jpg wget -O JPEGOUT http://$IP/axis-cgi/jpg/image.cgi?resolution=640x480&compression=25 Any ideas on how to get the output file name to parse correctly?

    Read the article

  • Parsing the output of "uptime" with bash

    - by Keek
    I would like to save the output of the uptime command into a csv file in a Bash script. Since the uptime command has different output formats based on the time since the last reboot I came up with a pretty heavy solution based on case, but there is surely a more elegant way of doing this. uptime output: 8:58AM up 15:12, 1 user, load averages: 0.01, 0.02, 0.00 desired result: 15:12,1 user,0.00 0.02 0.00, current code: case "`uptime | wc -w | awk '{print $1}'`" in #Count the number of words in the uptime output 10) #e.g.: 8:16PM up 2:30, 1 user, load averages: 0.09, 0.05, 0.02 echo -n `uptime | awk '{ print $3 }' | awk '{gsub ( ",","" ) ; print $0 }'`","`uptime | awk '{ print $4,$5 }' | awk '{gsub ( ",","" ) ; print $0 }'`","`uptime | awk '{ print $8,$9,$10 }' | awk '{gsub ( ",","" ) ; print $0 }'`"," ;; 12) #e.g.: 1:41pm up 105 days, 21:46, 2 users, load average: 0.28, 0.28, 0.27 echo -n `uptime | awk '{ print $3,$4,$5 }' | awk '{gsub ( ",","" ) ; print $0 }'`","`uptime | awk '{ print $6,$7 }' | awk '{gsub ( ",","" ) ; print $0 }'`","`uptime | awk '{ print $10,$11,$12 }' | awk '{gsub ( ",","" ) ; print $0 }'`"," ;; 13) #e.g.: 12:55pm up 105 days, 21 hrs, 2 users, load average: 0.26, 0.26, 0.26 echo -n `uptime | awk '{ print $3,$4,$5,$6 }' | awk '{gsub ( ",","" ) ; print $0 }'`","`uptime | awk '{ print $7,$8 }' | awk '{gsub ( ",","" ) ; print $0 }'`","`uptime | awk '{ print $11,$12,$13 }' | awk '{gsub ( ",","" ) ; print $0 }'`"," ;; esac

    Read the article

  • Real-time log parsing and reporting

    - by Alienfluid
    We have a small project we are working on part-time that runs on Nginx/MongoDB on Ubuntu 10.04 LTS Server. We'd like to be able to see reports on things like server load, requests/sec, response time, DB load, DB response time, etc. Is there an open source or free (as in beer) tool that can parse such logs and provide a real-time report? I looked into Splunk briefly, but I wanted to see if there are any others that are highly recommended.

    Read the article

  • Parsing text files

    - by d03boy
    I encountered a situation tonight where I wanted to parse a text file. I had a very, very long word list that contained English words delimited by lines. I wanted to get rid of every word (or line) that was longer than 7 characters. This would be simple in Linux but I can't seem to find a simple solution in WindowsXP. I tried using Notepad++ regular expression search but that was a huge failure. I tried using the expression .{6,} without finding any matches. I'm really at a loss because I thought this sort of thing would be extremely easy and there would be tons of tools to accomplish a task like this. It seems like Notepad++ supports every other feature in the world except the very basic ones that seem the most obvious. Another one of my goals was to put some code before and after the word on each line. aardvark apple azolio would turn into INSERT INTO Words (word) VALUES ('aardvark'); INSERT INTO Words (word) VALUES ('apple'); INSERT INTO Words (word) VALUES ('azolio'); What suggestions/tools/tips do you have to accomplish tasks similar to this in WindowsXP?

    Read the article

  • Nmap XML parsing with Powershell

    - by Craig620
    I am trying to parse the XML output from NMAP and isolate just the hostadddress and the vendor from the osmatch. I've actually done that with the following: select-xml -path nmap.xml -xpath "nmaprun/host/address/@addr|nmaprun/host/os/osmatch/osclass/@vendor" | select -expandproperty node Which produces: #text ----- 10.20.30.1 HP 10.20.30.2 Linux 10.20.30.3 HP What I was not expecting is that it would jam it all into a single column.Silly me would like the address in one column, and the vendor in another column. I Would like: #addr #vendor ----- ------- 10.20.30.1 HP 10.20.30.2 Linux 10.20.30.3 HP In the several hours I spent learning xpath today, I also realized that this file has a single address for each host, but multiple OS guesses for each host. I would also like to use only the first osGuess in the output. Tired using: -xpath "(nmaprun/host/os/osmatch/osclass/@vendor)[1]" But that truncates the whole data set to a single line of output, instead of only limiting the only the first osclass element of each host. Changing the parens to surround only the @vendor element like .../(@vendor)[1] and .../(@vendor[1]) but both fail with "Expression must evaluate to a node-set." Thanks in advance

    Read the article

  • batch file infinite loop when parsing file

    - by Bart
    Okay, this should be a really simple task but its proving to be more complicated than I think it should be. I'm clearly doing something wrong, and would like someone else's input. What I would like to do is parse through a file containing paths to directories and set permissions on those directories. An example line of the input file. There are several lines, all formatted the same way, with a different path to a directory. E:\stuff\Things\something else (X)\ (The file in question is generated under Cygwin using find to list all directories with "(X)" in the name. The file is then passed through unix2win to make it windows compatible. I've also tried manually creating the input file from within windows to rule out the file's creation method as the problem.) Here's where I'm stuck... I wrote the following quick and dirty batch file in Windows XP and it worked without any issues at all, but it will not work in server 2k8. Batch file code to run through the file and set permissions: FOR /F "tokens=*" %%A IN (dirlist.txt) DO echo y| cacls "%%A" /T /C /G "Domain Admins":f "Some Group":f "some-security-group":f What this is SUPPOSED to do (and does in XP) is loop through the specified file (dirlist.txt) and run cacls.exe on each directory it pulls from the file. The "echo y|" is in there to automagically confirm when cacls helpfully asks "are you sure?" for every directory in the list. Unfortunately, however, what it DOES is fall into an infinite loop. I've tried surrounding everything after "DO" with quotes, which prevents the endless loop but confuses cacls so it throws an error. Interestingly, I've tried running the code from after "DO" manually (obviously replacing the variable with the full path, copied straight from the file) at a command prompt and it runs as expected. I don't think it's the file or the loop, as adding quotes to the command to be executed prevents the loop from continuing past where it's supposed to... I really have no idea at this point. Any help would be appreciated. I have a feeling it's going to be something increadibly stupid... but I'm pulling my hair out so I thought I'd ask.

    Read the article

  • Browser not parsing PAC file properly?

    - by mfinni
    I have a long PAC file. The browser(s) (IE and Chrome) are configured to use it and it generally does what it says on the tin. I have a domain that continues to go through the proxy although it should be going direct. // Match specific hosts and IPs entered as hosts if (buncha stuff || shExpMatch(host,"(*.newmarketinc.com)") || shExpMatch(host,"(newmarketinc.com)") || buncha stuff ) return "DIRECT"; Pactester shows that anything in the domain should be direct. h:\pacparser\pactester.exe -p h:\pacfile -u http://daas.newmarketinc.com DIRECT But we continue to pass traffic to hosts in this domain via the proxy. Wireshark and Fiddler both show this. How do i figure out how my browser has gotten brain-damage? Traffic to other sites in this stanza does properly go direct, as confirmed by Fiddler and Wireshark.

    Read the article

  • grabbing/parsing iSCSI iface information

    - by chrisg
    I'm writing a puppet provider for iSCSI and want to grab information about the ifaces (in my case HBAs) we have, is there a better way than doing this: iscsiadm -m iface -I be2iscsi.00:00:00:00:00:00|grep iface.ipaddress|sed -e 's/iface.ipaddress = //' it looks pretty ugly, but the -n switch doesn't seem to work unless you're in --op=update is there a better way to grab this information, in particular in ruby?

    Read the article

  • Parsing out known strings from Excel spreadsheet

    - by user1631862
    I have an Excel spreadsheet that has a list of names in column A. What I'd like to do is parse out all the names in the column that I don't know and their rows. For example, in a spreadsheet of 100 names, let's say I know 39 of them and their row data. I don't need to see them in the spreadsheet - what I need to see are the remaining 61 that I don't know and their rows. Hope that makes sense, and that something like this is possible! Thanks!

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >