• There seems to be an uptick in Political comments in recent months. Those of us who are long time members of the site know that Political and Religious content has been banned for years. Nothing has changed. Please leave all political and religious comments out of the forums.

    If you recently joined the forums you were not presented with this restriction in the terms of service. This was due to a conversion error when we went from vBulletin to Xenforo. We have updated our terms of service to reflect these corrections.

    Please note any post refering to a politician will be considered political even if it is intended to be humor. Our experience is these topics have a way of dividing the forums and causing deep resentment among members. It is a poison to the community. We appreciate compliance with the rules.

    The Staff of SOH

  • Server side Maintenance is done. We still have an update to the forum software to run but that one will have to wait for a better time.

Text editing question!

MaskRider

Tiller of Soil
How does one go about finding-replacing text in a standard text file- such as a layout file- so that the replace function gets rid of the entire line and does not leave a space? I am trying to thin out layout files so that I can offer a heavy and light version. I create an airfield layout file with lots of trees in it- all of them the same- wofi's stand of 5 palms. Then, to thin it out and create a light version of the layout file, I go into a text editing program- it doesn't make much difference which cause I haven't yet been able to accomplish what I want- and try to delete every other tree object line. Problem is that while I can easily get rid of the name part of the line I still have not figured out how to get rid of the rest of the string- the co-ordinate part that follows. I want to replace the entire line with nothing. I want everyother tree entry line to just disappear. Any ideas how to do this?

Thanks!

MR
 
If .lay is standard text. I would think old Notepad would work. You'll have to right click Open than find Notepad on the list. You may want uncheck always use this program when opening this type of program.
 
Thanks Allen. I probably didn't make myself clear. I already know how to open the .lay files in several different editors, Notepad. Wordpad, MSWord, Notepad++ and how to use the basic replace commands. I'm tryinmg to figure how to identify lines that contain a model name and not just replace the object name or delete the object name but delete the entire line that contains the object name. When I click "replace" I want the entire line containing the object name to disappear and leave behind no blank line.

MR
 
Hi The Editor!

That is a very interesting and useful website! However, what I need is something that will allow me to skip thru the "find this" hits and only delete every other one. In other words, I want it to stop after each find and give me the option of deleting or skipping to next.

Notepad++ is kind of neat. With it, I can put a tik mark next to the lines I want to delete- every other one containing Palme03 for instance- and then choose "delete and collapse" all lines with a tik mark".

I think I may end up sticking with Notepad++ for a while unless I can come up with some sort of macro to handle it for me- writing macros is not something I am very hip to.

Thanks very much though. You never know what you are going to find if you ask!

MR
 
wouldn't just using the find work? then remove the row you want? i'll look at the .lay and get back to you.

have you tried open office? it might have better features.
 
it appears that find and next are it. then you are left with the position.

if you leave out the item and save, will it open again in mission builder?

i'll try that and get back to you.

nope it doesn't like it. i was hopeing that it would ignore it.

maybe you can add it to a spreadsheet and have it removed that way. then just paste it back into notepad.
 
I think i have a solution.

open .lay doc in notepad.

select all and copy.

paste in to a spreadsheet.

now in the case of open office if you hold [Crtl] you can select multiple cells.

once you have all that you want just delete them.

then copy and paste back into notepad and save.

easy enough. you can even use the find function.

thats the best i've been able to come up with MR
 
I think i have a solution.

open .lay doc in notepad.

select all and copy.

paste in to a spreadsheet.

now in the case of open office if you hold [Crtl] you can select multiple cells.

once you have all that you want just delete them.

then copy and paste back into notepad and save.

easy enough. you can even use the find function.

thats the best i've been able to come up with MR

Excellent suggestion. I hadn't thought of handling it as a spreadsheet. Although Notepad++ kind of allows you to do so.

Thanks!

MR
 
it appears that find and next are it. then you are left with the position.

if you leave out the item and save, will it open again in mission builder?

'll try that and get back to you.

nope it doesn't like it. i was hopeing that it would ignore it.

maybe you can add it to a spreadsheet and have it removed that way. then just paste it back into notepad.

Oh, yeah. I hadn't thought of just leaving the position data in the line minus the object name. But yes, CFS2 is pretty touchy. It expects information in those .lay files to presented in a certain fashion and if it isn't, it doesn't work.

Thanks for checking it out.

MR
 
Back
Top