LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-30-2013, 10:20 PM   #16
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,281

Rep: Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916

Quote:
Originally Posted by LinusStallman View Post
Goto Gedit and select "Sort", that's what I mean.

2.txt (.html) was sorted in Calc and then copied back into Kompozer. 1.txt can be disregarded now.
i'm still not getting it . this is what i get when trying to sort with gedit:
Code:



  
  
  
  
  
		<!-- 
		 -->
		BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Arial"; font-size:x-small }
</body></html>
  <colgroup width="534"></colgroup> <tbody>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
duis convallis vestibulum. Arcu eget. Vitae nulla dictum per, vitae
</head><body>
<html><head>
ipsum dolor sit amet, ultricies nisl pretium laoreet, blandit nullam
lorem doloribus arcu, non aliquet natoque blandit, purus ornare atque
  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  <meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
  <meta name="GENERATOR" content="LibreOffice 3.6  (Linux)">
orci, nulla pede, interdum suscipit eu fermentum est faucibus.</font></td>
  <style>
	</style>
</table>
<table style="width: 100%;" border="0" cellspacing="0" cols="1">
  </tbody>
      <td align="left" height="17"><font face="Times New Roman" size="+1"><a href="https://www.youtube.com/user/AvaazOrg">youtube.com/AvaazOrg</a></font></td>
      <td align="left" height="17"><font face="Times New Roman" size="+1"><a href="http://www.youtube.com/user/AsapSCIENCE">youtube.com/AsapSCIENCE</a></font></td>
      <td align="left" height="17"><font face="Times New Roman" size="+1"><a href="http://youtube.com/ehow">youtube.com/ehow</a></font></td>
      <td align="left" height="17"><font face="Times New Roman" size="+1"><a href="http://youtube.com/howcast">youtube.com/howcast</a></font></td>
      <td align="left" height="17"><font face="Times New Roman" size="+1">Perspective - The Future of Earth <a href="http://i.imgur.com/bwXbe.gif">imgur.com/bwXbe.gif</a></font></td>
      <td style="height: 62px; text-align: left;"><font face="Times New Roman" size="+1">Lorem
  <title>2</title>
    </tr>
    </tr>
    </tr>
    </tr>
    </tr>
    </tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
vestibulum nibh lorem mi varius est. Fringilla sollicitudin consequat
looks kinda' like garbage html (it is the same exact output as the sort command on the command-line).
i would like to help you. but unless you provide a clear before-and-after picture i dont think anyone will be able to decipher what you need ?

Is this by chance for an xbmc add-on ?

Last edited by schneidz; 08-30-2013 at 10:44 PM.
 
Old 08-31-2013, 03:27 AM   #17
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,790

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Quote:
Originally Posted by schneidz View Post
i'm still not getting it . this is what i get when trying to sort with gedit:

...

Is this by chance for an xbmc add-on ?
Hi schneidz.

Think of the GUI appearance of the lines and not the code appearance. e.g. from this

Code:
youtube.com/AsapSCIENCE
youtube.com/ehow
Lorem ipsum dolor sit amet, ultricies nisl pretium laoreet, blandit nullam duis convallis vestibulum. Arcu eget. Vitae nulla dictum per, vitae vestibulum nibh lorem mi varius est. Fringilla sollicitudin consequat lorem doloribus arcu, non aliquet natoque blandit, purus ornare atque orci, nulla pede, interdum suscipit eu fermentum est faucibus.
Perspective - The Future of Earth imgur.com/bwXbe.gif
youtube.com/AvaazOrg
youtube.com/howcast
to this

Quote:
Lorem ipsum dolor sit amet, ultricies nisl pretium laoreet, blandit nullam duis convallis vestibulum. Arcu eget. Vitae nulla dictum per, vitae vestibulum nibh lorem mi varius est. Fringilla sollicitudin consequat lorem doloribus arcu, non aliquet natoque blandit, purus ornare atque orci, nulla pede, interdum suscipit eu fermentum est faucibus.
Perspective - The Future of Earth imgur.com/bwXbe.gif
youtube.com/AsapSCIENCE
youtube.com/AvaazOrg
youtube.com/ehow
youtube.com/howcast
No, this is not for an XBMC addon.
 
Old 08-31-2013, 10:52 AM   #18
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,281

Rep: Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916
got it. i've made a few xbmc programs that parse html links in python (some no longer work becuz the format of the site they scrape from have been changed).
http://hyper.homeftp.net/xbmc/

the basic method i used was to find some common regex that surronds the text i am interested in, trim it in some fashion, and present it to the screen in some way.

maybe you can parse it with awk using <tr> as a record seperator ?

Last edited by schneidz; 08-31-2013 at 11:01 AM.
 
Old 08-31-2013, 01:34 PM   #19
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,790

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Question

Quote:
Originally Posted by Firerat View Post
http://tablesorter.com/docs/#Download

...

load that file in browser, click on the header (Link)
Hi Firerat.

Could you clarify it a bit?

Load what file and where is the header?
 
Old 08-31-2013, 06:08 PM   #20
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
the html file you create


in the example I was lazy and just unzipped the jquery/tablesort Javascript to the same dir as the html

Of course this could all be overkill, but I'm not all that clear on what your end goal is.

Regards the header.... I didn't include it, I'm lazy.. The example was really just an example you will probably want more columns and better formatting.

But like I said, I don't do html, I have no real need for it
 
Old 09-01-2013, 09:32 AM   #21
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,281

Rep: Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916
I'm not sure if there is a cookie-cutter solution. I think you will need to create some sort of custom parser that can operate on the specific format of your HTML.
 
  


Reply

Tags
html, lines, sort


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bash: sort lines in 2 files so that equal lines are at the same line number... masavini Programming 10 06-21-2012 02:58 PM
[SOLVED] [Perl] fail to sort a file with 300,000 lines by multiple columns Kunsheng Programming 10 11-13-2009 07:41 PM
sort lines inside blocks in a file llattan Linux - Newbie 9 04-05-2009 02:19 PM
Is there a line limit with the sort utility? Trying to sort 130 million lines of text gruffy Linux - General 4 08-10-2006 09:40 PM
How can I sort the lines in a file? windhair Linux - Software 2 11-17-2005 09:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration