I'm trying to extract text from a log file, match on a group then extract and output a specific error in a text file.
----static title Start ----
lots of junk in here [128587] [date] Missing important
more junk same same same Missing important.Test.beta
so much junk same same same Missing important.update.package
random information here Missing important.old
----static title End----
Initially I tried
----static\stitle\sStart----(\n.+)\n----static\stitle\sEnd---
which will group and extract all of text to a new result text file file trouble is I only need the specific variables that appear after Missing and extract them to a text file they either appear as single words or appended with full points '.' before the next word.
important
important.update.package
important.Test.beta
important.old
I'm looking to match on what appears after missing and output it as a list.
(?<=Missing)\s+\w+.+?\w+?.+?|\w+?.+?
As its a list I probably need a carriage return in here too still work in progress.
Regards,
Arc
I figured out the answer to this myself.
[(^Missing)](\s+\w+\.?[^\s]+)
Matches on first whitespace and words with optional '.' between each word up until the next whitespace!
Related
I have numerous files where the address field is in a single line of text, for the most part separated by a comma. My first step is using 'Replace' function in Excel to replace comma's with a carriage return. This is to turn an address from a single line into multiple lines.
The issue I'm looking to get assistance with, is when I complete the steps above, a leading space is often remaining in all rows from the second row onwards. I would like to know the best way to remove the leading spaces in these rows and keep the format of multi-line addresses.
I have tried using TRIM however these returns the address back to a single line
To show the pre and post transformed data I've added an image below as I can't seem to get the format to show correctly here on this post. Due to my profile being new I also can't imbed the image so there is a link below showing the pre and post transformed data, and the leading space issue I'm seeking help with
Pre and Post Example
Thanks,
Steve
As #Anonymous mention in comment, replace both comma and space at a time by SUBSTITUTE() formula and use WRAP TEXT format of resulting cell.
=SUBSTITUTE(A2,", ",CHAR(10))
I am writing a research paper where I need to use DOI numbers of the references. But for some references, it is showing unnecessary white spaces (see the 1st attached file) since the DOI can not be fitted in the line. To solve this problem I used shift+enter to break the DOI number into two separate lines. It kind of solves the problem (see the 2nd attached file) but when I convert the word file into PDF, and click on the DOI number it leads to an error page instead of the referred journal page.
How to solve this issue? Is there any good way to Split the DOI numbers in two lines without getting error?
Not very elegant, but you could use shortDOI.org on those that create too ugly whitespace.
If you use a reference manager, replace the original URL/DOI there with your shortened version.
I have a file with two fields. I need to change the first field values from lowercase to uppercase. Can anyone give me a suggestion on how can I do this?
sample file data
e6|VerizonOctoberWB_PromoE7E6
e2|VerizonOctoberWB_UnlimwP_E1E2
e5|VerizonOctoberWB_PromoLI_E5
In above sample data I need to change the first field values(e6,e2,e5)
Given your small and poorly formatted sample:
cat up
e6|VerizonOctoberWB_PromoE7E6
e2|VerizonOctoberWB_UnlimwP_E1E2
e5|VerizonOctoberWB_PromoLI_E5
sed -r 's/^([^|]+)/\U\1\E/g' up
E6|VerizonOctoberWB_PromoE7E6
E2|VerizonOctoberWB_UnlimwP_E1E2
E5|VerizonOctoberWB_PromoLI_E5
Edit 1: added explanation:
search for and remember everything from beginning of line up to the first separator |, replace with \U(start upper-casing), \1 remembered string, \E stop upper-casing.
I have an excel column which contains data but each cell contains data in multiple lines. Some of the lines are empty and some of the lines are filled. Now I want to extract only that line which contain a specific word e.g "shipping". Many thanks for everybody in advance.
Best Regards
Try this:
=IF(ISERR(FIND("shipping",LOWER(B1))),0,FIND("shipping",LOWER(B1)))
The "IF(ISERR())" eliminates any ugly '#VALUE!' error messages
The "LOWER()" makes sure mixed case words aren't overlooked
enter image description here
I would like to trim off the text which is after the bracket in the cell Value
The current formula I'm using keeps giving me the error not being able to extract the targetted string.
=LEFT([#[Name ]],FIND("(",[#[Name ]]))
I want to go shopping (Today)
Goal: Is to remove
(Today)
Expected Result:
I want to go shopping
One of these should do.
=TRIM(LEFT([name], FIND("(", [name]&"(")-1))
=TRIM(REPLACE([name], FIND("(", [name]&"("), LEN([name]), TEXT(,)))
Note that I suffixed the original text with the character that the FIND is looking for. In this manner, it will always be found even if it is not in the original text.
You may find that you have a rogue trailing space in the Name header label.