• Home
  • Index
  • Search
  • Download
  • Server Rules
  • House Roleplay Laws
  • Player Utilities
  • Player Help
  • Forum Utilities
  • Returning Player?
  • Toggle Sidebar
Interactive Nav-Map
Tutorials
New Wiki
ID reference
Restart reference
Players Online
Player Activity
Faction Activity
Player Base Status
Discord Help Channel
DarkStat
Server public configs
POB Administration
Missing Powerplant
Stuck in Connecticut
Account Banned
Lost Ship/Account
POB Restoration
Disconnected
Member List
Forum Stats
Show Team
View New Posts
View Today's Posts
Calendar
Help
Archive Mode




Hi there Guest,  
Existing user?   Sign in    Create account
Login
Username:
Password: Lost Password?
 
  Discovery Gaming Community The Community Real Life Discussion Software & Hardware
« Previous 1 … 87 88 89 90 91 Next »
Advanced text search

Server Time (24h)

Players Online

Active Events - Scoreboard

Latest activity

Pages (2): 1 2 Next »
Advanced text search
Offline Igiss
09-13-2007, 12:23 PM,
#1
Discovery Creator
Posts: 3,181
Threads: 578
Joined: Jun 2005

Is there any ways to find what's lacking in the test file(s), not what's in there?

For example: I need to find entries where the "=" sign is not accompanied by a space before and after. Everywhere else there is a space, like "name = xyz", but in some places it might look like "name=xyz". The second variant is wrong, and I need to find such entries and correct them. Manual search won't work, since number of entries is enormous.

Is there any software for doing such things, or (better) is there a way to do this in an ordinaty text editor like EditPlus or EditPadPro?
Reply  
GlyphStorm
09-13-2007, 12:29 PM,
#2
Unregistered
 

In the regular notepad, CTRL+F does what you request, and it finds this kind of search you are interested. If you want to edit some .ini files, maybe Notepad is the solution:)

Anyway, ctrl+f is a regular combination for in-text search. Try this in your text programs, it may work.

My computer knowledge is very limited, hope this helps:D

Glyph
Reply  
Offline Korrd
09-13-2007, 02:44 PM,
#3
Member
Posts: 3,714
Threads: 241
Joined: Aug 2005

I don't know any program with the not modifier on the search field. Still, i can write a little proggie to make the job, and correct the mistakes automatically.

[Image: 3cfefe54.jpg]

Server Status | Server Rules | Players Online | Player Rankings | Freelancer Account Manager
(If you find any mistake in my English, please let me know via a PM)
(Really, I speak terrible English, so please, tell me if I make mistakes. I'd like to improve it a bit Smile)
  Reply  
Offline RingoW
09-13-2007, 02:56 PM,
#4
Member
Posts: 1,399
Threads: 65
Joined: Aug 2007

In the editor normally is a function "Exchange". Now you are ordered to tipp in what are you searching for and another field you make your entry with what the serched one shall be exchanged. This might be the fastest way i think.
Reply  
Offline Igiss
09-14-2007, 12:52 AM,
#5
Discovery Creator
Posts: 3,181
Threads: 578
Joined: Jun 2005

Angel of Mercy, it's not what you are thinking about.

Korrd, a program would be very nice. If possible, let it open a bunch of ini files at once (with subdir search), and search, not necessarily fix (better fix manually). It's for FL modding, obviously.
Reply  
Offline Treewyrm
09-14-2007, 02:07 AM,
#6
Alchemist
Posts: 2,084
Threads: 61
Joined: Jul 2007

I think what you mean is called regular expressions. A very powerful string search and replace engine. It's not very friednly though, sometimes you can loose your head trying to understand what that long expression means but still it's very useful, I have been using it for quite some time and it came out handy at times saving a lot of time.

http://en.wikipedia.org/wiki/Regular_expression
http://www.regular-expressions.info/

Many advaned text editors support regular expressions in some way. I can't say if EditPad does, I use TextPad personally, but I'm sure it does.

I can make you replacement expression if you tell me what symbols are allowed in those values (especially if spaces are allowed within the value).

In your case it would probably be this (doesn't work if you have spaces in values, for that it needs to be modified a little bit):

Search expression: "^([[:alnum:]]+)[\ ]*\=[\ ]*([[:alnum:]]+)$"
Replace expression: "$1 = $2" with <strike>PCRE_UNGREEDY flag set on</strike> (figued it's not needed there)

Look for regular expression support in your text editor, usually it is in "search and replace" tool, typically a checkbox enabling usage of expressions in fields.

I use regular expressions a lot when I need to clean up someone's else code (I like when everything looks in the very same style and syntax).

edit:

Ok, here is search expression if you want to have spaces (or just any symbol except for "=" and newline) in values: "^(?U)(.*)[ ]*\=(?-U)[ ]*(.*)$". Replace expression is the same as in previous example.

All it does it looking for lines with pair "value1= value2" no matter now many spaces are between "value" and "=" (there can be none, one, two, three spaces, etc), the result will always turn it into "value1 = value2" pair.

I hope this helps.

Regular expression is a very powerful tool. Coding a dedicated program for this purpose is overkill, IMO.
Reply  
Offline Korrd
09-14-2007, 03:48 AM,
#7
Member
Posts: 3,714
Threads: 241
Joined: Aug 2005

I will begin writing a specific version this Saturday, as right now I'm on a deadline to deliver a project module for my work. I have to complete it for... yesterday... D: so i can't give a split second to anything else, or my boss will kick me to that prison system that was just added..

[Image: 3cfefe54.jpg]

Server Status | Server Rules | Players Online | Player Rankings | Freelancer Account Manager
(If you find any mistake in my English, please let me know via a PM)
(Really, I speak terrible English, so please, tell me if I make mistakes. I'd like to improve it a bit Smile)
  Reply  
Offline Igiss
09-14-2007, 03:08 PM,
#8
Discovery Creator
Posts: 3,181
Threads: 578
Joined: Jun 2005

Treewyrm: EditPad does support regular expressions, but the ones you've posted didn't help for some reason. Probably used them incorrectly, or... anyway, they scare me.

And a program won't be an overkill. With more searches through ini than just "=" it could become a good tool for modders that can even be released for public. I had a hard time finding a text editor that could open many ini files at once with subdir search, for example.
Reply  
Offline sawtyss
09-14-2007, 07:37 PM,
#9
Member
Posts: 101
Threads: 18
Joined: Jul 2007

Igiss... I can write you a simple Bash command-line script that can do it for you, and display which line the error (wrongly put = ) was in

[Image: sigbjk.png]
  Reply  
Offline Treewyrm
09-14-2007, 07:57 PM,
#10
Alchemist
Posts: 2,084
Threads: 61
Joined: Jul 2007

Ok, I fixed expression for EditPad, it uses different syntax for inline modifiers, here is the one that works: "^(.*?)[ ]*\=[ ]*(.*)$". I tested it in EditPad (installed it specifically to see what's wrong) and it works.

[Image: regex-1.gif]
Reply  
Pages (2): 1 2 Next »


  • View a Printable Version
  • Subscribe to this thread


Users browsing this thread:
1 Guest(s)



Powered By MyBB, © 2002-2025 MyBB Group. Theme © 2014 iAndrew & DiscoveryGC
  • Contact Us
  •  Lite mode
Linear Mode
Threaded Mode