How to Modify this?
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
How to Modify this?
Hi All...
I'm really need advice how to edit large file txt format like this :
original file:
' abolish ' => ' annul ', ' abolition ' => ' extermination ', ' abominable ' => ' monstrous '
i need to replace like this :
' abolish ' => ' abolish ', ' abolition ' => ' abolition ', ' abominable ' => ' abominable '
And then how to make the exel file like this:
column1 column2 column3
' abolish ' = > ' abolish '
' abolition ' = > ' abolition '
Thanks a lof for all help,
I'm really need advice how to edit large file txt format like this :
original file:
' abolish ' => ' annul ', ' abolition ' => ' extermination ', ' abominable ' => ' monstrous '
i need to replace like this :
' abolish ' => ' abolish ', ' abolition ' => ' abolition ', ' abominable ' => ' abominable '
And then how to make the exel file like this:
column1 column2 column3
' abolish ' = > ' abolish '
' abolition ' = > ' abolition '
Thanks a lof for all help,
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
Use "Posix" regular expression syntax:
Search | Replace... (<F8>):Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
I don't understand your requirement concerning Excel files. TextPad is a text editor. Please restate what you need purely in terms of the text that you will pass to Excel.Find what: ^'([^']+)' => '[^']+', '([^']+)' => '[^']+', '([^']+)' => '[^']+'
Replace with: '\1' => '\1', '\2' => '\2', '\3' => '\3'
[X] Regular expression
Replace All
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
Do you mean there may be many '...' => '...' pairs on a line?
If so, try this:
Search | Replace... (<F8>):
If so, try this on the adjusted text:
Search | Replace... (<F8>):
If so, try this:
Search | Replace... (<F8>):
Do you mean you want each adjusted pair to end up on a separate line?Find what: '([^']+)' => '[^']+'
Replace with: '\1' => '\1'
[Replace the underscore with a space]
[X] Regular expression
Replace All
If so, try this on the adjusted text:
Search | Replace... (<F8>):
These assume you are using Posix regular expression syntax:Find what: ,_ [Replace the underscore with a space]
Replace with: \n
[X] Regular expression
Replace All
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
Find what: '([^']+)' => '[^']+'
Replace with: '\1' => '\1'
this work....i love this tool....
Now i have the data like this:
' disparity ' => ' disparity ', ' dispassionate ' => ' dispassionate ', ' dispatched ' => ' dispatched ', ' dispatcher ' => ' dispatcher '
its posible to change all in bold word ex: (p) with (q)
TQ TQ TQ
Replace with: '\1' => '\1'
this work....i love this tool....
Now i have the data like this:
' disparity ' => ' disparity ', ' dispassionate ' => ' dispassionate ', ' dispatched ' => ' dispatched ', ' dispatcher ' => ' dispatcher '
its posible to change all in bold word ex: (p) with (q)
TQ TQ TQ
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
Is each pair is on a separate line?
If so, you can do this in steps:
1. Move all the text in each line starting at "=>" to the right:
Configure | Block Select Mode
3. Select a block on the right that includes all of your last column but none of your first column.
4. Make the replacement within the selection:
If so, you can do this in steps:
1. Move all the text in each line starting at "=>" to the right:
2. Turn on block select mode (this requires you to be using a fixed-width font):Find what: =>
Replace with: [Lots of spaces]=>
Replace All
Configure | Block Select Mode
3. Select a block on the right that includes all of your last column but none of your first column.
4. Make the replacement within the selection:
5. Remove the spaces you put in earlier:Find what: i
Replace with: T
[X] Selected text
Replace All
(6. Turn off block select mode.)Find what: _+=> [Replace the underscore with a space]
Replace with: [Lots of spaces] _=> [Replace the underscore with a space]
[X] Regular expression
Replace All
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm