Page 1 of 2 |
|
Posted: Mon, 1st Mar 2010 16:28 Post subject: how to alter txt files |
|
 |
I need to alter hundreds of lines. the lines that i want to remove always start with the same expression.
So, how to do this? well - i could write a little app - but I`m sure there`s an editor that can do this.
find exprssion on beginning of each line - delete the line.
|
|
Back to top |
|
 |
TSR69
Banned
Posts: 14962
Location: Republic of the Seven United Provinces
|
Posted: Mon, 1st Mar 2010 16:33 Post subject: |
|
 |
hmm yes some alteration in words and expressions is very important if you want to produce some quality text
perhaps writing something and then print it and reread the stuff you wrote an hour or so later is best way if you want to stay creative
an semantic algorithm that helps you with it, kills the creativity
Formerly known as iconized
|
|
Back to top |
|
 |
|
Posted: Mon, 1st Mar 2010 16:38 Post subject: |
|
 |
I use UltraEdit for such tasks. You simple record a macro for one line and play it over the whole file. Its done in 5 minutes.
|
|
Back to top |
|
 |
|
Posted: Mon, 1st Mar 2010 16:48 Post subject: |
|
 |
FastMemFirst wrote: | I use UltraEdit for such tasks. You simple record a macro for one line and play it over the whole file. Its done in 5 minutes. |
thx - will try
|
|
Back to top |
|
 |
|
Posted: Mon, 1st Mar 2010 17:11 Post subject: |
|
 |
Notepad++ free alternative to ultraedit.
|
|
Back to top |
|
 |
|
Posted: Mon, 1st Mar 2010 17:19 Post subject: |
|
 |
Couldn't you do it with Find and Replace? Just enter the expression you want to delete in the 'Find' field leaving the 'Replace with' field blank. Click 'Replace All' and you should be done without the need for any other program/macro/script.
|
|
Back to top |
|
 |
nouseforaname
Über-VIP Member
Posts: 21306
Location: Toronto, Canada
|
|
Back to top |
|
 |
|
|
Back to top |
|
 |
Parallax_
VIP Member
Posts: 6422
Location: Norway
|
Posted: Mon, 1st Mar 2010 20:24 Post subject: |
|
 |
Notepad++ supports regexp replacing.
|
|
Back to top |
|
 |
Lutzifer
Modzilla
Posts: 12740
Location: ____________________ **** vegan zombie **** GRRAAIIINNSS _______
|
Posted: Mon, 1st Mar 2010 22:14 Post subject: |
|
 |
yeah, notepad++ is really neat for that. I never got it to do multiple lines though. If somebody knows a tool for that as well, post it here =)
edit: i also like crimson editor alot, when it comes to free txt editors. Both can search and replace over all opened files, which is also pretty neat imho 
|
|
Back to top |
|
 |
|
Posted: Tue, 2nd Mar 2010 01:27 Post subject: |
|
 |
thx guys - i used my favourite editor editplus.
the regular expression function is pretty usefull (even if its not so mighty as some languages).
Problem was - if the comment starts mid of a line, it should just delete the rest of the line, and even there have been some exceptions. Got it working.
|
|
Back to top |
|
 |
|
Posted: Tue, 2nd Mar 2010 03:10 Post subject: |
|
 |
Haha, I thought , I was a sooo smart when I had to figure that out 2 yrs ago. Worked fine for me. with the proggieI found!!! ME <--apple. I know you hate me!!!!
|
|
Back to top |
|
 |
|
|
Back to top |
|
 |
Lutzifer
Modzilla
Posts: 12740
Location: ____________________ **** vegan zombie **** GRRAAIIINNSS _______
|
Posted: Tue, 2nd Mar 2010 18:50 Post subject: |
|
 |
hey, we all love apple, we just cant all express it properly (or dont have the money to make apple love us back )
|
|
Back to top |
|
 |
nerrd
Posts: 3607
Location: Poland / USA
|
Posted: Tue, 2nd Mar 2010 19:57 Post subject: |
|
 |
Slightly off topic:
For a while I've been looking for a text editor that would let me sort each line of that file alphabetically. Also I need an app to compare two almost identical text files and let me see what, if anything differs between them. Would any of the above suggested editors let me do that?
|
|
Back to top |
|
 |
Lutzifer
Modzilla
Posts: 12740
Location: ____________________ **** vegan zombie **** GRRAAIIINNSS _______
|
Posted: Tue, 2nd Mar 2010 20:42 Post subject: |
|
 |
i use total commander for file comparisons (and nearly everything else). As for alphabetical ordering of text. You could try to copy and paste or import it into excel maybe and just order it alphabetically?
|
|
Back to top |
|
 |
|
Posted: Tue, 2nd Mar 2010 22:38 Post subject: |
|
 |
Yes, Total Commander is the swiss army knife for the daily file operation tasks. Cant live without since NC has stopped development. UltraEdit does everything you could imagine with texts, all type of sorting and replacing you ever need. Not quite sure but the free Notepad++ should be able to sort too.
|
|
Back to top |
|
 |
nerrd
Posts: 3607
Location: Poland / USA
|
Posted: Tue, 2nd Mar 2010 23:47 Post subject: |
|
 |
I almost got a hardon when I saw the file compare feature in Total Commander. Perfect for what I need it to do. Reminds of something I used back in the DOS days. Norton Commander perhaps?
Now playing with UltraEdit, and seems that once I figure out how to use the sort feature properly it will work just fine.
TYVM for help.
|
|
Back to top |
|
 |
Lutzifer
Modzilla
Posts: 12740
Location: ____________________ **** vegan zombie **** GRRAAIIINNSS _______
|
Posted: Tue, 2nd Mar 2010 23:51 Post subject: |
|
 |
yeah, it's very much like norton commander and i even have set the colours to blue / yellow so it looks more like it =)
|
|
Back to top |
|
 |
nouseforaname
Über-VIP Member
Posts: 21306
Location: Toronto, Canada
|
Posted: Tue, 2nd Mar 2010 23:53 Post subject: |
|
 |
without googling ... does total commander handle non txt files like .doc or .docx for comparison?
asus z170-A || core i5-6600K || geforce gtx 970 4gb || 16gb ddr4 ram || win10 || 1080p led samsung 27"
|
|
Back to top |
|
 |
nerrd
Posts: 3607
Location: Poland / USA
|
Posted: Wed, 3rd Mar 2010 00:00 Post subject: |
|
 |
Just tried comparing two bitmaps and the program did that without complaining. I would assume it will compare anything you throw at it.
|
|
Back to top |
|
 |
nouseforaname
Über-VIP Member
Posts: 21306
Location: Toronto, Canada
|
|
Back to top |
|
 |
nerrd
Posts: 3607
Location: Poland / USA
|
Posted: Wed, 3rd Mar 2010 00:04 Post subject: |
|
 |
It displays each file side by side, highlighting the differences between the two. You get an option to copy each line from/to either file with a click of a button.
|
|
Back to top |
|
 |
nouseforaname
Über-VIP Member
Posts: 21306
Location: Toronto, Canada
|
|
Back to top |
|
 |
Lutzifer
Modzilla
Posts: 12740
Location: ____________________ **** vegan zombie **** GRRAAIIINNSS _______
|
Posted: Wed, 3rd Mar 2010 00:10 Post subject: |
|
 |
nouseforaname wrote: | but what kind of output does it give? the actual text that is different in each file?
I guess I'm asking along the lines of version control since sometimes coworkers forget to track changes on docs we're co-working on  |
depends on the docs. With word documents it doesnt "work" that well, but anything that is mainly text, it s really good.
if you want to do it oldschool, you can always do it from a command prompt with 'fc' as well 
|
|
Back to top |
|
 |
|
Posted: Wed, 3rd Mar 2010 00:45 Post subject: |
|
 |
Version controlling? SVN... Or do you want to see the diffs in .DOC files?
|
|
Back to top |
|
 |
nouseforaname
Über-VIP Member
Posts: 21306
Location: Toronto, Canada
|
|
Back to top |
|
 |
|
|
Back to top |
|
 |
Lutzifer
Modzilla
Posts: 12740
Location: ____________________ **** vegan zombie **** GRRAAIIINNSS _______
|
|
Back to top |
|
 |
|
Posted: Wed, 3rd Mar 2010 01:02 Post subject: |
|
 |
SVN is free and open source We use it on a daily basis and sometimes we make love with it too because it is so awesome 
|
|
Back to top |
|
 |
Page 1 of 2 |
All times are GMT + 1 Hour |