I used this instruction https://www.sublimetext.com/docs/2/column_selection.html
still when I cut it only cuts 2 chars instead of the whole column of "00:00" why ?
You haven't selected a column. If you look carefully, you've only selected the 00 on the first line, and the rest of them are highlighted because they match the current selection. Make sure you are using the correct key/mouse sequence for your operating system from the documentation you linked to, then select the entire column, not just the first two characters.
While holding down Ctrl + Alt, press ↓ until you reach the end of the column. It will clone your cursor down the column. Then, use Shift + → or ← key to select text. Once selected do whatever you want with it.
Related
One of my columns has a value that looks like this -> "$5.95 (Park costs)"
and I need to display the value in column in SSRS report like this:
$5.95
(Park costs)
but font size of "(Park costs)" must be smaller than the price.
Is something like that even possible? To somehow make text that does not contain a number, dot or dollar sign smaller?
You can do this. You'll need to split up each component of the text column and then place each half in a placeholder. You can then format each placeholder individually.
This solution assumes that your column always contains a "(". If not you should be able to modify it to suit.
I Generated some test data and and placed it in a normal table (tablix) control.
I then added some new columns for testing that each part was working as expected.
The expression for "Cost" column is
=TRIM(LEFT(Fields!MyColumn.Value,InStr(Fields!MyColumn.Value, "(") -1))
The expression for the "Caption" column is
=TRIM(RIGHT(Fields!MyColumn.Value, LEN(Fields!MyColumn.Value) - InStr(Fields!MyColumn.Value, "(") + 1))
Once this was working OK I added the "Final Column".
To add a placeholder, click inside the textbox so the cursor appears then right-click and choose "Create Placeholder"
I added two placeholders with a space between then and set the values to the expressions above respectively. I then right clicked the placeholders chose "Placeholder Properties" and formatted each individually.
The final output looks like this. (I left the test columns in for clarity)
I have certain product codes with varying number of letters/digits e.g. 53HD6J, HH88WBD3 (varies between 5 to 10 letters/digits). In order for our barcode to scan these correctly there has to be 13 letters/digits. I don't want to make the user to input -XXXX after each code but rather have Access calculate the difference between 13 and the length of the code and fill the remaining with a X's. Is this possible either by vba or and expression?
I currently am using about 6 IIFs in one formula to fill remaining blanks with X's but hoping there is an easier way.
I have a form to enter in the batch number (product code). Once that form is submitted it links to a report that is printed. On the report are those batch numbers (53HD6J, HH88WBD3). The spot I want to have this feature is in a text box right next to the codes where Access determines the length of the codes and computes the remaining X's to add. This is in barcode font so this text box is where the 53HD6JXXXXXXX would go. Hope that clears it up!
So I have that part figured out. My problem now is my barcode font reads the text no matter what and translates it still so barcode shows up when the batch number is blank (I have four spots for batch codes to be inputted). So what I had before was =IIf([Text31]="",""&[Text31]&"","") which seemed to work. Hopefully I can continue this with the new formula. If that's unclear let me know.
**(The "" & & "" is so the barcode can be scanned).
My formula was wrong right above with the IIf. I figured it out! Forgot I had used ' Like "*" '. Thanks!
You can do what you want with String() and Left().
Here is an example from the Access Immediate window:
product_code = "53HD6J"
? product_code & String(13, "X")
53HD6JXXXXXXXXXXXXX
? Left(product_code & String(13, "X"), 13)
53HD6JXXXXXXX
Based on the update to your question, I think you can use that approach for the Control Source of a text box where you want to display the "expanded" product code.
Pretend your report has a text box named txtProduct_code where the raw product code, such as 53HD6J, is displayed. And there is a second text box where you want to display that value with the required number of X characters (53HD6JXXXXXXX).
Use this as the Control Source property of that second text box:
= Left([txtProduct_code] & String(13, "X"), 13)
Alternatively, you could make it a field expression in the report's Record Source query.
SELECT
product_code,
Left(product_code & String(13, "X"), 13) AS expanded_product_code
FROM YourTable;
I want to edit multiple lines and every "word" within that line. For example:
45 28 42 65
24 87 47 95
01 25 87 98
I want to select every whole number in all lines and put a "0x" before it so it would look like:
0x45 0x28 0x42 0x65
0x24 0x87 0x47 0x95
0x01 0x25 0x87 0x98
I know the Ctrl+shift+L to get cursors on each line, but how can I get the cursors in front of every number to mass edit all at once?
Highlight the lines and use:
Windows: Ctrl+Shift+L
Mac: Cmd ⌘+Shift+L
You can then move the cursor to your heart's content and edit all lines at once.
It's also called "Split into Lines" in the "Selection" menu.
Use multiple cursors and column selection.
In your case you just need to place the cursors at the beginning of each column containing the "words".
Linux and Windows
Click & drag to select column(s): Shift + RightMouseBtn
Add other column(s) to selection by click & drag: Ctrl + Shift + RightMouseBtn
Subtract column(s) from the selection: Alt + Shift + RightMouseBtn
Add individual cursors: Ctrl + LeftMouseBtn
Remove individual cursors: Alt + LeftMouseBtn
Mac
Click & drag to select column(s): Option⌥ + LeftMouseBtn
Add other column(s) to selection by click & drag: Option⌥ + LeftMouseBtn
Subtract column(s) from the selection: Cmd⌘ + Option⌥ + shift + LeftMouseBtn
Add individual cursors: Cmd⌘ + LeftMouseBtn
Remove individual cursors: Cmd⌘ + Option⌥ + shift + LeftMouseBtn
Then edit as needed. In your case, type 0, x.
You could also navigate as needed to the end or beginning of the words, select the words and surround with quotes or parenthesis, and so on.
References:
Column selection
Worked for me on OS X + Sublime build 3083:
OPTION (ALT) + select lines
I'm not sure it's possible "out of the box". And, unfortunately, I don't know an appropriate plugin either.
To solve the problem you suggested you could use regular expressions.
Cmd + F (Find)
Regexp: [^ ]+ (or \d+, or whatever you prefer)
Option + F (Find All)
Edit it
Hotkeys may vary depending on you OS and personal preferences (mine are for OS X).
I was facing the same problem on Linux,
what I did was to select all the content (ctrl-A) and then press ctrl+shift+L,
It gives you a cursor on each line and then you can add similar content to each column.
Also you can perform other operations like cut, copy and paste column wise.
PS :- If you want to select a rectangular set of data from text, you can also press shift and hold Right Mouse button and then select data in a rectangular fashion. Then press CTRL+SHIFT+L to get the cursor on each line.
Windows:
I prefer Alt+F3 to search a string and change all instances of search string at once.
http://www.sublimetext.com/docs/selection
On Windows, I prefer Ctrl + Alt + Down.
It selects the lines one by one and automatically starts the multi-line editor mode. It is a bit faster this way. If you have a lot of lines to edit then selecting the text and Ctrl + Shift + L is a better choice.
ctrl + shift + right-click
it works better that way
If you are looking to select the same word / value in multiple lines to then edit it, you can simply press "COMMAND + D" on the first entry and then keep pressing "D" to select the lines below
It's fine to manually select each number for a small set of numbers like in your example, but for larger collections you can do a regex search which will do the work for you.
Ctrl + F will open the search bar.
Regex searches are enabled by clicking the ".*" button on the far left.
Type in "\d+" to search for all occurrences of 1 or more digits. Clicking the "Find All" button will select each of these numbers separately.
Then you can use Ctrl + Shift + L to convert the selection into multiple cursors. From here you can do as you like.
Is there any plugin or shortcut to hide all except code section in sublime text 2?
I need to fold all except section at a time , Not fold one section at a time.
Thanks~
If you'll hover with the mouse over the line numbers you'll see arrows - clicking on any of them will fold/collapse the code
If you want to collapse/expand all - you can do so by going to edit->code folding and choose "fold all" or "unfold all":
In addition to the other answers it is also possible to fold based on level as well. So for example looking at the default key bindings for fold.
Searching for fold key bindings.
So for example a foldall, or folding level 1 would be to hold Ctrl followed by pressing the sequence k and then 1:
Or folding level 2 would be to hold Ctrl followed by pressing the sequence k and then 2:
Or unfolding all would be would be to hold Ctrl followed by pressing the sequence k and then 0 or in my defaults I also seem to have it bound to the letter j:
Warning.
Pressing Ctrl+k twice will remove a line or a count of lines.
But not really cause you can put them back one by one by Ctrl+u
One thing you can do is select the Except code bloc using a regular expression, for instance using except(.|\n)*?raise.* in your case. You can then select "Find all" in the search bar, then Edit->Code Folding -> Fold .
Windows shortcut : Ctrl-Shift-[
Mac shortcut: Cmd-Alt-[
All the Except bloc will then be collapsed.
I know this is an old question, but it still comes up high in search results and none of the answers quite do what the OP wanted.
select the code you don't want to be hidden
use "Selection" -> "Invert Selection" to select the code you do want to be hidden instead
use ctrl + shift + [ or Command + Option + ] to collapse the selection(s)
This will leave you with just the code you originally had selected visible.
Fold and UnFold function or class base only for MAC:
* Fold: command + K, command + 1
* UnFold: command + K, command + J
$_POST['daily_limit'];
$whatever = $_POST['smoke'];
$_POST['soup'] + $_POST['cake'];
to
$this->input->post('daily_limit');
$whatever = $this->input->post('smoke');
$this->input->post('soup') + $this->input->post('cake');
In this example, is there any faster way to switch from $_POST[] to $this->input->post() without writing up a regular expression find and replace? I don't care if it takes multiple steps. Writing the regex for this (find: \$_POST\[(.*?)\] replace: \$this->input->post\($1\)) takes longer than changing them all manually (maybe I'm just not good at regex). Any ideas?
I'm making a brash assumption here, that you have only one variable within each pair of brackets and that the variables only contain alphanumeric characters. ['soup'+'bacon'] will break this trick, as will ['soup-with-bacon'].
With your cursor, highlight an instance of $_POST[ - nothing else.
Hit Alt+F3 if you're on Windows/Linux (Cmd+ShiftG in Mac?)
Try to scroll through and see if everything that's selected is everything you want to replace.
Type $this->input->post( - nothing else.
Press → to move all cursors to the right of the first quote.
Press Ctrl+→ (this is the only remotely wtfh4xxy part of the process, and only if you're not used to navigating by word with the cursor) to navigate over the variable.
Press → twice to move all cursors to the right of the next quote.
Replace the ]with a ).
#nnnn I did a variation of your version to remove the wtfh4xxy part.
select:$_POST
altf3
type: $this->input->post(
ctrlshiftm
ctrlx
ctrlshiftm
ctrlv
type: )
Sublime text ftw!