How to copy last 13 characters of a string? - character

In Notepad++ I have a list of entries and at the end of each entry is a phone number (with dashes, 12 characters total). How do I go about either removing all the text before the number or copy/cut the number from the end of the entry for multiple entries? Thanks!
i.e.
1 $1,300 Deposit $1,300 Available 12/15/16 2050 Hurricane Shoals 678-790-0986
2 7 $1,400 Deposit $1,400 Available 12/22/16 1453 Alamein Dr  404-294-6441
3 $1,500 - $1,590 Not Income Based  /  Deposit $1,500 - $1,590 678-328-7952

Here is a way:
Ctrl+H
Find what: ^.*([\d-]{12})$
Replace with: $1
Replace all

Related

Extract specific values (n digit long and starting with a number) PSQL

I have two string like this and I want to extract 6 digits starting from "2007" using postgresql. Please help
"472a62b98b-2004-07-l-de_k-de_n-email_t-cus_200703"
"21d6bd96f2-2004-04-l-de_c-de_m-email_t-cus_200705-b"
Results would be:
"200703"
"200705"
You can use substring() with a regex:
substring(the_column from '2007[0-9]{2}')
This extracts the first substring that starts with 2007 and is followed by (exactly) two digits.

Find rows where string contains certain character at specific place

I have a field in my database, that contains 10 characters:
Fx: 1234567891
I want to look for the rows where the field has eg. the numbers 8 and 9 in places 5 and 6
So for example,
if the rows are
a) 1234567891
b) 1234897891
c) 1234877891
I only want b) returned in my select.
The type of the field is string/character varying.
I have tried using:
where field like '%89%'
but that won't work, because I need it to be 89 at a specific place in the string.
The fastest solution would be
WHERE substr(field, 8, 2) = '89'
If the positions are not adjacent, you end up with two conditions joined with AND.
You should be able to evaluate the single character using the underscore(_) character. So you should be able to use it as follows.
where field like '____89%'

Modelica combiTimeTable

I have a few questions regarding combitimeTables: I tired to import a txt file (3 columns: first time + 2 measured data)into a combitimeTable. - Does the txt file have to have the following header #1; double K(x,y) - Is it right, that the table name in combitimeTable have to have the same name than the variable after double (in my case K)? - I get errors if i try to connect 2 outputs of the table (column 1 and column2). Do I have to specify how many columns that I want to import?
And: Why do i have to use in the path "/" instead of "\" ?
Modelica Code:
Modelica.Blocks.Sources.CombiTimeTable combiTimeTable(
tableOnFile=true,
tableName="K",
fileName="D:/test.txt")
Thank you very much!
The standard text file format for CombiTables is:
#1
double K(4,3)
0 1 10
1 3 20
2 5 30
3 7 40
In this case note the "tableName" parameter I would set as a modifier to the CombiTable (or CombiTimeTable) is "K". And yes, the numbers in parenthesis indicate the dimensions of the data to the tool, so in this case 4 rows and 3 columns.
Regarding the path separator "/" or "\", the backslash character "\" which is the path separator in Windows where as the forward slash "/" is the path separator on Unix like systems (e.g. Linux). The issue is that in most libraries the backslash is used as an escape character. So for example "\n" indicates new line and "\t" indicates tab so if my file name string was "D:\nextfolder\table.txt", this would actually look something like:
D:
extfolder able.txt
Depending on your Modelica simulation tool however it might correct this. So if you used a file selection dialog box to choose your file, the tool should automatically switch the file separator character to the forward slash "/" and your text would look like:
combiTimeTable(
tableOnFile=true,
tableName="K",
fileName="D:/nextfolder/table.txt",
columns=2:3)
If you are getting errors in your connect statement, I would guess you might have forgotten the "columns" parameter. The default value for this parameter comes from the "table" parameter (which is empty by default because there are zero rows by two columns), not from the data in the file. So when you are reading data from a file you need to explicitly set this

Postgresql: Processing Text, Detect out of Alphabetical order rows

I have some processed text that's in (mostly) alphabetical order, e.g. these are the first word of each paragraph:
Adelanto
Agoura Hills
Alameda
Albany
Old Albany
New Albany
Alhambra
Aliso Viejo
Alturas
So each of the words above represents the start of a paragraph e.g.:
Adelanto, a city in San Bernardino County, California about 9 miles (14 km) northwest of Victorville in the High Desert portion of the Inland Empire of the Greater Los Angeles Area...
The text can have many paragraphs per entry so that paragraphs not in alphabetical order are treated as new entries.
So each entry would correspond to a place.
In the Example, O(ld) is after A(lbany) so Old Albany is a Entry, but N(ew) is before O(ld), so New Albany a continuation of Old Albany.
My question is: Is there something already existing other than just using the ASCII character difference between the first letter of Albany and Old Albany/New Albany in Postgresql? E.g. ASCII ('A') - ASCII ('O') gives -14.
So do I just use ASCII values on the first characters? Or is there a more general solution?
Currently I'm using the ASCII difference between the first letters of the text, comparing to the previousRow.description and also nextRow.description e.g.
ABS (ASCII (substring ( currentRow.description, 1,1 ) ) -
ASCII ( substring ( previousRow.description, 1 ,1 ) )

notepad++ replace a string in next (3 or 4 ) lines

I have a text file of 183419 lines, where I would like to replace the entire line of:
3 _TYPE PHOTO
with:
3 _TYPE DOCUMENT
but only if it is 3 or 4 lines after a line that begins with:
3 FILE d:\genie\grogan\doc\......
For example:
3 FILE d:\genie\grogan\doc\mills\Mills Albert 1884 Birth Partial Transcript.jpg
3 TITL Mills Albert 1884 Birth Partial Transcript
3 _SCBK Y
3 _TYPE PHOTO
or:
3 FILE d:\genie\grogan\doc\mills\Mills Albert 1884 DeathTranscript.jpg
3 TITL Mills Albert 1884 DeathTranscript
3 _SCBK Y
3 _PRIM Y
3 _TYPE PHOTO
but not for this situation:
3 FILE d:\genie\grogan\photos\grogan edward\Grogan Thelma Simpson Jim.jpg
3 _SCBK Y
3 _TYPE PHOTO
This is a task that would be required to be run monthly.
Do a regular expression search and replace, ensure Dot matches newline is not selected. Setting Find what to ^(3 FILE d:\\genie\\grogan\\doc\\(.*\r\n){3,4})3 _TYPE PHOTO$ and Replace with to \13 _TYPE DOCUMENT.
The (.*\r\n){3,4} part matches the end of the genie\\grogan\\doc line plus 2 or 3 more complete lines. The (3 FILE ... )3 _TYPE PHOTO$ part matches the two specified strings and the enclosing brackets capture all the text except for the line to be replaced. The \1 in the replacement string inserts the captured text, the rest of the string is the new text wanted.
Tested with Notepad++ 6.3.2 on your test lines.
Depending on your line endings, you may need to adjust the \r\n part of the Find what string. The examples do not cover all the options, so you may also need to change the {3,4} part to {4,5} depending on the exact meaning of "only if it is 3 or 4 lines after"
Bookmark your lines
Do a regular expression to bookmarked lines only (just like AdrianHHH said)