I want to be able to shift everything from position x to the end of the line , back to position x. using regex
This can be done with block mode; selecting everything after a certain position and then using the reduce indent button.
I have huge files that may have lines anywhere from 20 to 600 characters long. Selecting a 6,000 lines from a fixed position to the end of the longest line is problematic.
Thanks in advance
shift columns using regex
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Your problem description is unclear. Can you please provide examples of the data before and after the change? Please enclose the data in
Code: Select all
[/color][/b]...[b][color=blue][/code ][/color][/b] tags to retain the whitespace and layout.Sure thing:
before
After:
There are over 6000 lines of this. All lines are variable in length; from as few as twenty to hundreds of characters.
There are many of these files
before
Code: Select all
data more data more data more data more data
data more data more data more data more data more data more data more data more data more data more data more data
data more data more data more data more data more data more data more data more data
data more data more data more data more data more data more data more data more data more data more data more data more data more data more data
data more data more data more data more data more data more data more data more data
Code: Select all
data more data more data more data more data more data
data more data more data more data more data more data more data more data more data more data more data more data
data more data more data more data more data more data more data more data more data
data more data more data more data more data more data more data more data more data more data more data more data more data more data more data
data more data more data more data more data more data more data more data more data
There are many of these files
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
If you want to use regular expressions, firstly enable POSIX regular expression syntax in Configure > Preferences > Editor.
Then, to always leave 16 spaces after data (where there are 16 or more spaces originally), perform a Replace operation as follows:
Find what: (data_{16})_*(.*) (replace the underscores with spaces)
Replace with: \1\2
Then, to always leave 16 spaces after data (where there are 16 or more spaces originally), perform a Replace operation as follows:
Find what: (data_{16})_*(.*) (replace the underscores with spaces)
Replace with: \1\2