You are here: PSPad forum > English discussion forum > RegExpression in Search/Replace in files
Posted by: federico | Date: 05/10/2009 01:51 | IP: IP Logged
Hello everybody,
I have happily used PSPad over 4 years now.
My PSPad version is 4.3.1.
My main usage of PSPad is about the feature: "Search/Replace in files". I use that to replace pieces of text in projects including a multitude of files.
So I ask PSPad experts if with the latest version (or the versions later than 4.3.1) new functionalities were added to "Search/Replace in files".
I would like if "RegExpression" were added. In PSPad 4.3.1, "RegExpression" is enabled only if you are performing Search/replace in a single file.
However if that is not the case, provided my limited usage of PSPad, could you advise which advantages I would get by upgrading to latest version?
Thanks
Posted by: vbr | Date: 05/10/2009 09:52 | IP: IP Logged
federico:Hello everybody,
I have happily used PSPad over 4 years now.
My PSPad version is 4.3.1.My main usage of PSPad is about the feature: "Search/Replace in files". I use that to replace pieces of text in projects including a multitude of files.
So I ask PSPad experts if with the latest version (or the versions later than 4.3.1) new functionalities were added to "Search/Replace in files".
I would like if "RegExpression" were added. In PSPad 4.3.1, "RegExpression" is enabled only if you are performing Search/replace in a single file.However if that is not the case, provided my limited usage of PSPad, could you advise which advantages I would get by upgrading to latest version?
Thanks
Hi,
the current version of PSPad doesn't support RE in "Search in files" either. (Some script addons are available operating on all open files, but this isn't probably suitable enough.)
The main advantage of the 4.5... series is unicode support, i.e. you can display and save characters beyond your national system codepage. If you don't need this, the basics are probably quite similar, however, there are many incremental enhancements added, which may or may not be helpful for you.
Anyway, if you don't use PSPad for usual editing but only for mass text replacments, there are likely other specialised programs for that, or editors with better support for this particular task.
vbr
Posted by: MrSpock | Date: 05/10/2009 12:58 | IP: IP Logged
vbr:Anyway, if you don't use PSPad for usual editing but only for mass text replacements, there are likely other specialised programs for that, or editors with better support for this particular task.
I use TextCrawler for this kind of thing.
Posted by: federico | Date: 05/11/2009 03:46 | IP: IP Logged
Thanks to everybody for your quick replies.
Quote:I use TextCrawler for this kind of thing.
Following your suggestion I had a try to TextCrawler. It seems a good piece of software. However it does not fit my needs because it does not work with .sql files.
Also it finds/replaces blocks of text only in a single line -- just as PSPad does. Is there a software around that replaces blocks of text spanning multiple lines?
Coming to .sql files, PSPad would be ok because it changes the color of the code when any error happens.
Now I would like shortly describing below what my major needs are (so anybody could suggest me if have to upgrade latest version PSPad or look for another piece of software).
I have to download from servers large files (in format .csv ,.text, .xml) that then I import in a mysql database (through PhpMyAdmin) and then export (after manipulating data) in format sql in PSPad. In PSPad I perform on it various operations (mass replacement etc...) and finally, when the .sql file manipulation is completed, I import again the file on the mysql database (through php scripts the mySql data will be displayed on web pages).
Based on what I have described above, do you think the latest PSPad could help me in manipulating sql data? What I would like is the possibility to manipulate directly in PSPad the text/csv files after downloading it from servers and then converting them in sql files. All in PSPad.
Examples of my data manipulating needs are: deletion of columns, changing position of the columns etc...
Does have PSPad something similar to built-in scripts helping in performing such operations? Maybe I am asking too much... (and too many questions)
Thanks a lot.
Posted by: vbr | Date: 05/11/2009 09:57 | IP: IP Logged
I have only a loose idea of SQL, but I had the impression, this kind of converting (SQL - txt ... SQL ...) should not be necessary, as the database columns are more easily manipulated within SQL than as text.
Anyway, PSPad does support scripting (since version 4.3.3), check the helpfile (Customize PSPad :: Script), there are some user contributed scripts at
www.pspad.com
or you can check a small sample I posted earlier
forum.pspad.com
which was basically a series of replacements and other editor actions on the given text. (this way you can use multiline search and replace too)
The features of scripting are being added incrementally, there are significant enhancements since the first version.
vbr
Posted by: MrSpock | Date: 05/11/2009 12:07 | IP: IP Logged
Depending on what your data look like, exporting them to csv, manipulating them in a spreadsheet application, and then reimporting them might also be an option. I always feel that spreadsheets are the best way to handle data in a table-like layout, but ymmv.
Posted by: ArchCarrier | Date: 05/12/2009 09:31 | IP: IP Logged
Is there a particular reason why you don't want to make your database changes in PHPMyAdmin? The examples of data manipulating you describe can be done through the Operations and Structure tabs of PHPMyAdmin.
Text replacement within tables (even using regular expressions) can be done through SQL queries.
In my experience, manipulating databases through text files can quickly lead to errors in the database.
Posted by: federico | Date: 05/13/2009 02:49 | IP: IP Logged
Quote:Is there a particular reason why you don't want to make your database changes in PHPMyAdmin? ....
I experienced that data manipulating on mysql database on the web server is resource consuming. So, all manipulating processes in PHPMyAdmin are slow and I suppose my website too is slow while manipulating data -- my websites and databases are on shared servers.
I just limit data manipulating in PHPMyAdmin to essential operations, such as deletion of columns or change position of columns
Also, even if I assume PHPMyAdmin is a pretty flexible tool, it is not enough to perform some operations.
Posted by: jirkaB | Date: 02/15/2012 23:29 | IP: IP Logged
I am working with hundreds small files (graphical source files around 800 lines) and this function is main one which is missing for me and I need to work with Perl in this case.
Please try to implement this function.
Thanks
See small example of source files (Ovation graphics language – made by Emerson / Westinghouse)
IF ((L:lo1_id DS = on7) AND (L:lo1_id AP < L:a_priority))
SET_VARIABLE L:a_priority L:lo1_id AP
COLOR FG black BG grey70 ER ivory4 OL 0 BLINK FG OFF BG OFF
GCODE 1 L:lo1_id
ENDIF
*****************************************************
RECTANGLE 0 0 530 400 1 outline outline
PROCESS_PT 30 27 4 0 RIGHT OFF HORZ VECTOR_OVER 100 345 1 L:analog_id AV
*Quality color definitions - background depends on alarm state, foreground on state FAIL POOR BAD TIMEOUT
TEXT 420 27 " " { ((L:analog_id 1W = ON8) AND (L:analog_id 1W = OFF9)) "F"
((L:analog_id 1W = OFF8) AND (L:analog_id 1W = ON9)) "P" ((L:analog_id 1W = ON8) AND
(L:analog_id 1W = ON9)) "B" (L:analog_id 1W = HDWRFAIL) "T" } HORZ VECTOR_OVER 100 345 1
Edited 1 time(s). Last edit at 02/15/2012 23:30 by jirkaB.
Editor PSPad - freeware editor, © 2001 - 2013 Jan Fiala
Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák