Overclock.net banner

1 - 6 of 6 Posts

·
Registered
Joined
·
250 Posts
Discussion Starter #1
I'm editing a config file and have stuff like

Code:

Code:
"hgun_mas_mp7p_F", "hgun_mas_mp7p_F_e", "hgun_mas_mp7p_F_sd"
But need it like

Code:

Code:
"hgun_mas_mp7p_F",
"hgun_mas_mp7p_F_e",
"hgun_mas_mp7p_F_sd"
and there is ALOT of it. How can I quickly make it like so? I need each one to end with that , and there are 3 tabs infront of the 1st ".
I'm using notepad++ is there a script or program to make this go by quick?

Thanks,
Higgins909
 

·
Not new to Overclock.net
Joined
·
77,936 Posts
You might be able to find a code cleaner or organizer or beautifier or whatever on the internet. I found a few for CSS when I needed it. I mean, web pages that you just put your code into.
 

·
Registered
Joined
·
672 Posts
If you're using Notepad++:

CTRL+H

Find what: ", " (without quotations, assuming those are spaces between each)
Replace with: "\n" (without quotations)

Check the "Extended" box under search mode. Click Replace All.
 

·
Registered
Joined
·
250 Posts
Discussion Starter #4
Quote:
Originally Posted by Hyrox View Post

If you're using Notepad++:

CTRL+H

Find what: ", " (without quotations, assuming those are spaces between each)
Replace with: "\n" (without quotations)

Check the "Extended" box under search mode. Click Replace All.
I think I figured out how to get that to work for me. Thank you very much, you've saved me hours of stress.
 

·
Registered
Joined
·
250 Posts
Discussion Starter #5
How would I add a line of text after each of these lines?

Code:

Code:
     class arifle_mas_hk416
        class arifle_mas_hk416_t
        class arifle_mas_hk416_h
        class arifle_mas_hk416_a
        class arifle_mas_hk416_e
        class arifle_mas_hk416_sd
        class arifle_mas_hk416_gl
        class arifle_mas_hk416_gl_t
        class arifle_mas_hk416_gl_h
        class arifle_mas_hk416_gl_a
        class arifle_mas_hk416_gl_e
If I do, find kh416_gl replace with hk416_gl price:1000 it will mess those last 4 up.
There are no spaces or anything after the 6 t h a e sd gl. I was thinking if I could somehow backspace all the classes a bit, then find class replace class with spacespaceclass it would work(2 spacebars then class) but I can't find anything about notepad ++ doing backspaces.
Then I could find spacespace and add my line of test after.
 

·
Registered
Joined
·
672 Posts
Quote:
Originally Posted by Higgins909 View Post

How would I add a line of text after each of these lines?

Code:

Code:
     class arifle_mas_hk416
        class arifle_mas_hk416_t
        class arifle_mas_hk416_h
        class arifle_mas_hk416_a
        class arifle_mas_hk416_e
        class arifle_mas_hk416_sd
        class arifle_mas_hk416_gl
        class arifle_mas_hk416_gl_t
        class arifle_mas_hk416_gl_h
        class arifle_mas_hk416_gl_a
        class arifle_mas_hk416_gl_e
If I do, find kh416_gl replace with hk416_gl price:1000 it will mess those last 4 up.
There are no spaces or anything after the 6 t h a e sd gl. I was thinking if I could somehow backspace all the classes a bit, then find class replace class with spacespaceclass it would work(2 spacebars then class) but I can't find anything about notepad ++ doing backspaces.
Then I could find spacespace and add my line of test after.
Here is my best guess at what you're asking.

Code:

Code:
Find what: "(class [A-Za-z0-9_]+)"
Replace with: "\1 price:1000"
Again, no parentheses around either of those strings. Also, check the "Regular expression" box this time instead of Extended.

Regular expressions are text strings for describing string search queries. Breaking down the first line:

Code:

Code:
Find what:"class" 
Example string: "class is boring"
Result: "class"
This just says search for the exact string class.

Code:

Code:
Find what: "class [A-Za-z0-9_]"
Example string: "class is boring"
Result: "class i"
The brackets mean match any character in the set capital A-Z, a-z, 0-9, or "_". So, this regular expression finds all instances of the string "class" followed by a space followed by any character in that set of characters.

Code:

Code:
Find what: "class [A-Za-z0-9_]+" 
Example string: "class is boringgg__!!!"
Result: "class is boringgg__"
The "+" sign means to match any continuous string matching the characters in the bracketed set.

Code:

Code:
Find what: "(class [A-Za-z0-9_]+)"
Replace with: "\1HELLO"
Example string: "class is boring"
Replace All Result: "class is boringHELLO"
The parentheses tell Notepad++ to store any search string it finds matching the contents of the parentheses for later use. On the replace with line, you'll see the "\1". This is telling Notepad++ to access the first variable stored in the search string.
 
1 - 6 of 6 Posts
Top