Hide Lines starting with a Hash #

Find, replace, find in files, replace in files, regular expressions

Hide Lines starting with a Hash #

Postby BerndWalter » Thu Nov 30, 2006 10:09 am

Hello Everybody!

We are currently evaluating UE and are now "playing arround" with it.

Right now I have loaded a config File with about 3000 Lines. Now i would like to "filter" out all Lines that start hash #

Example:

Original File:

# text1
# text2
text3
# text4

Result after "filtering"

text3


I hope you can help me.

Thanks in Advance!

Bernd
User avatar
BerndWalter
Newbie
 
Posts: 4
Joined: Thu Nov 30, 2006 12:00 am

Re: Hide Lines starting with a Hash #

Postby Mofi » Thu Nov 30, 2006 10:31 am

Hide or delete the lines starting with #?

Hiding a single line is not possible, only blocks with at least 3 lines. And it's not possible with the code folding engine to hide line comment lines. Block comments are suggested for code folding. However, a consecutive number of line comments could be hide with a macro.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Hide Lines starting with a Hash #

Postby BerndWalter » Thu Nov 30, 2006 10:43 am

so, there is no possibility to hide or filter out lines with a ceratin content, hmm.
I didn't expect that.

Anyhow, thanks for your help. Looks like we need to watch out for a different Product.

Bernd
User avatar
BerndWalter
Newbie
 
Posts: 4
Joined: Thu Nov 30, 2006 12:00 am

Re: Hide Lines starting with a Hash #

Postby Bego » Thu Nov 30, 2006 10:57 am

No. Or better: It depends if you can live with that:

Do a perl-regexp-style search and mark "list lines containing search string".
Then you can copy the result (the non-# lines) to clipboard and work with the result.
search: ^(^(\s)*#)

Explanation: NOT (Line-start + maybe some spaces + # sign).

Disadvantage: You can't work on the filtered result and "unfilter" it again.
Its a one-way street.

Code: Select all
# text1
  # text2
text3 # gfrhgr
# text4


Code: Select all
text3 # gfrhgr



rds Bego
User avatar
Bego
Master
Master
 
Posts: 357
Joined: Wed Nov 24, 2004 12:00 am
Location: Germany

Re: Hide Lines starting with a Hash #

Postby BerndWalter » Thu Nov 30, 2006 10:59 am

The Thing is, we would like to deploy it on up to 50 or more Machines. This feature was a basic requirement for the Tool. As UE doesn't have it "out of the Box" it's no option anymore.

Regards,

Bernd
User avatar
BerndWalter
Newbie
 
Posts: 4
Joined: Thu Nov 30, 2006 12:00 am

Re: Hide Lines starting with a Hash #

Postby BerndWalter » Fri Dec 01, 2006 8:16 am

Hi Again!

I haven't found any Text Editor on the web that is able to filter out lines. I can't believe that. How difficult is it to integrat that in UE? Maybe they plan to integrate a feature like that...

Regards
User avatar
BerndWalter
Newbie
 
Posts: 4
Joined: Thu Nov 30, 2006 12:00 am

Re: Hide Lines starting with a Hash #

Postby Mofi » Fri Dec 01, 2006 11:35 am

I guess, it is extremly difficult. It's relatively easy for a browser to hide lines because the file is only viewed by the user and not edited. It's also relatively easy to hide extra information in documents/files which are designed to contain many hidden data like Word docs or pdf. But it is extremly difficult to hide lines from a text file where no hidden data information can be stored in the file itself. Problems while editing will also occur with line numbering, cursor movements, search functions, copy, cut and paste large areas with not displayed text data, ...

A simple solution for hiding the text itself, but not the lines, is to specify the lines starting with # as line comment in the wordfile and select as text color the color of the background. This will not look beautiful because many "empty" lines could exist, but it's maybe helpful for you.

I think the main reason why it is not possible to hide single lines in a text editor is because nobody (except you of course) seems to need this. Users which use text files use text files because nothing is hidden in a text file.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Hide Lines starting with a Hash #

Postby everseeker » Fri Jul 13, 2007 7:20 pm

I wonder if he really meant filter, not delete.......
User avatar
everseeker
Newbie
 
Posts: 5
Joined: Thu Aug 04, 2005 11:00 pm

Re: Hide Lines starting with a Hash #

Postby Mofi » Tue Mar 02, 2010 2:14 am

Filtering lines is possible with UltraEdit v16.00 or later, see power tip Hide, Show, and Delete Found Lines in UltraEdit/UEStudio.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Find/Replace/Regular Expressions