Welcome Guest.   Make a donation to an author on the site September 02, 2014, 04:24:32 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
View the new Member Awards and Badges page.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: IDEA : XML Stripper  (Read 2734 times)
mino.ganzerli
Participant
*
Posts: 1

View Profile Give some DonationCredits to this forum member
« on: October 18, 2011, 02:41:42 PM »

Hy all!
I've been using some of your utility (Shortcut Creator, OpeningHours, Screenshot Captor, to tell you some) and in the last months I'm searching for a way to manipulate, hem, strip, the XML tag from some XML files.
I'm a inSSIDer user ( http://www.metageek.net/products/inssider/ ) and I would like to save in XML bacause has a lot of info, more than saving in CSV, but to manage, organize and list wlan I'm using Libre Office.
The passage that I always do is :

open a text editor
search for ant XML marker and replace with "tab"
import the text in Libre Office Calc
start to organize the list
export the list to XML

If I have a tool that strip all the unwanted XML marker and give me the old plain text ready to import in Calc I will be really happy!
My final goal is to have a list of all the wlan in my city, divided per blocks, per streets, per channel and so on, but without the XML stripper it's a long and boring "search and replace hell"...
Maybe someone can help me?
Logged
Ath
Supporting Member
**
Posts: 2,201



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: October 18, 2011, 02:59:44 PM »

Usually, anyone requiring special XML formatting I direct to the Apache FOP project, but you'll find FOP is quite a tank to swat a fly with cheesy
Logged

rjbull
Charter Member
***
Posts: 2,749

View Profile Give some DonationCredits to this forum member
« Reply #2 on: October 18, 2011, 03:13:28 PM »

A quick Google search turns up a few SED and PERL scripts that might work, at least partially?
Logged
Ath
Supporting Member
**
Posts: 2,201



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: October 18, 2011, 03:28:37 PM »

SED or PERL are good choices for this case, I guess, the file-layout is rather static.
Logged

skwire
Moderator
*****
Posts: 4,038



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: October 18, 2011, 03:36:23 PM »

Why not use one of the dedicated XML editors out there instead of all this converting from XML and then converting back to XML?
Logged

rjbull
Charter Member
***
Posts: 2,749

View Profile Give some DonationCredits to this forum member
« Reply #5 on: October 18, 2011, 03:36:41 PM »

There's even:

Quote
XMLgawk

http://home.vrweb.de/~juergen.kahrs/gawk/XML/

XMLgawk is an experimental extension of the GNU Awk interpreter. It includes a small XML parsing library which is built upon the Expat XML parser. The parsing library is a very thin layer on top of Expat (implementing a pull-interface) and can also be used without GNU Awk to read XML data files. Both, XMLgawk and its XML puller library only require an ANSI C compatible compiler (GCC works, as do most vendors' ANSI C compilers) and a 'make' program.

XMLgawk provides the following functionality:

    * AWK's way of reading data line by line is supplemented by reading XML files node by node.
[...]
Someone has compiled binaries for Windows, though it looks like you might need Cygwin or something else as well.
Logged
MilesAhead
Member
**
Posts: 4,795



View Profile WWW Give some DonationCredits to this forum member
« Reply #6 on: October 18, 2011, 03:39:21 PM »

If you have to knock something together yourself you might try AutoIt3 using _StringBetween() function. This line I used with an xml subtitle file to get the start time:

[copy or print]
$lines = _StringBetween($chapterTimes[$x], "<ChapterTimeStart>", "</ChapterTimeStart>")

You could have a 2 dimensional array with start and end tags you are looking for if you only need to find a few tags. If it's wide-reaching then you may need to use RegEx patterns.  But to catch simple start and end tags _StringBetween should be good enough. It's easy to use.

If it finds the delimiters it returns an array of the strings between them.
Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
MilesAhead
Member
**
Posts: 4,795



View Profile WWW Give some DonationCredits to this forum member
« Reply #7 on: October 18, 2011, 03:44:37 PM »

Looks like this XmlGawk mod was compiled with MinGW as stand-alone Windows binary:

http://www.wim-blit.nl/xm...gawk%20for%20Windows.html
Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.034s | Server load: 0.12 ]