NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums General General Discussion v
« Previous 1 … 25 26 27 28 29 … 159 Next »
remove "leading spaces" from epg xml?

 
  • 0 Vote(s) - 0 Average
remove "leading spaces" from epg xml?
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#1
2011-11-04, 11:44 PM
Does anyone know how I can "wash" my XML-based through program that will remove the "leading spaces" from the XML?
I use batch file that I got from mvallevand (Thanks Martin, still works beautifully) to strip Chinese Characters, now just need to add something to remove the "leading spaces"

C:\Progra~1\GnuWin32\bin\sed -e "s/[\x00-\x1F\x7F-\xFF]//g" -e "s/()//g" C:\Utils\TVXB\XML\TVXB01XML\xmltvHKBTVTemp.xml > C:\Utils\TVXB\XML\TVXB01XML\xmltvHKBTV.xml

ta!

k.
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,918
Threads: 956
Joined: May 2006
#2
2011-11-05, 12:14 AM
Try this as the search expression

"s/^[ ]*//;s/[\x00-\x1F\x7F-\xFF]//g"


Martin
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#3
2011-11-05, 12:36 AM
Thanks Martin, quick as ever...but hmmm not quite? The ones that are correct are other replacements/clipping/concatentation using TVXB
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,918
Threads: 956
Joined: May 2006
#4
2011-11-05, 12:58 AM
I'm guessing you need to run sed twice, once to strip the characters to an intermediate xml file and another to strip the leading spaces.

Martin
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#5
2011-11-05, 01:02 AM
Hmm

I tried this

Code:
C:\Progra~1\GnuWin32\bin\sed -e "s/[\x00-\x1F\x7F-\xFF]//g" -e "s/()//g" C:\Utils\TVXB\XML\TVXB01XML\xmltvHKBTVTemp.xml > C:\Utils\TVXB\XML\TVXB01XML\xmltvHKBTVTemp1.xml
C:\Progra~1\GnuWin32\bin\sed -e "s/^[ ]*//;s/[\x00-\x1F\x7F-\xFF]//g" -e "s/()//g" C:\Utils\TVXB\XML\TVXB01XML\xmltvHKBTVTemp1.xml > C:\Utils\TVXB\XML\TVXB01XML\xmltvHKBTV.xml

but no change?
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,918
Threads: 956
Joined: May 2006
#6
2011-11-05, 01:36 AM
I get it now, it's not leading you want removed, it's multiple spaces (two spaces in front of the *)

"s/[\x00-\x1F\x7F-\xFF]//g;s/ */ /g"

Martin
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#7
2011-11-05, 01:57 AM
Hmm.... sorry :confused: still no joy...

Tried a single

C:\Progra~1\GnuWin32\bin\sed -e "s/[\x00-\x1F\x7F-\xFF]//g;s/ */ /g" C:\Utils\TVXB\XML\TVXB01XML\xmltvHKBTVTemp.xml > C:\Utils\TVXB\XML\TVXB01XML\xmltvHKBTV.xml

then tried a double

C:\Progra~1\GnuWin32\bin\sed -e "s/[\x00-\x1F\x7F-\xFF]//g" -e "s/()//g" C:\Utils\TVXB\XML\TVXB01XML\xmltvHKBTVTemp.xml > C:\Utils\TVXB\XML\TVXB01XML\xmltvHKBTVTemp1.xml
C:\Progra~1\GnuWin32\bin\sed -e "s/[\x00-\x1F\x7F-\xFF]//g;s/ */ /g" -e "s/()//g" C:\Utils\TVXB\XML\TVXB01XML\xmltvHKBTVTemp1.xml > C:\Utils\TVXB\XML\TVXB01XML\xmltvHKBTV.xml

k.
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,918
Threads: 956
Joined: May 2006
#8
2011-11-05, 02:16 AM
Maybe this

"s/[\x00-\x1F\x7F-\xFF]//g;s/> */>/g"

Martin
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#9
2011-11-05, 02:22 AM
Bingo :-) ! You da man! Thanks Martin!
I hope this helps others too.

k.
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
martint123
Offline

Posting Freak

UK, East Yorkshire
Posts: 4,658
Threads: 208
Joined: Nov 2005
#10
2011-11-05, 01:52 PM
mvallevand Wrote:"s/[\x00-\x1F\x7F-\xFF]//g;s/> */>/g"

Your location say Canada - I thought it was Mars from the above. :eek:
No wonder I never got far as an admin.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to remove devices from device list kralj3gs 6 2,578 2023-08-26, 08:38 PM
Last Post: sub
  What does NPVR remove when naming recordings p37307 0 1,693 2016-12-24, 10:55 AM
Last Post: p37307
  Colour spaces, picture quality - Nvidia cards Pob 4 3,606 2009-11-09, 10:47 PM
Last Post: Pob

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode