Search Results

Search: Posts Made By: mikayla73
2,218
Posted By mikayla73
Thanks that does work too, with one minor change....
Thanks that does work too, with one minor change. The ")" has to be a "}", which I am guessing was just a typo. :)

grep -oE 'word1_a[0-9]{6}' infile
2,218
Posted By mikayla73
THANK YOU!! I knew that grep -o would find...
THANK YOU!!

I knew that grep -o would find the word instead of the entire line, I didn't know I could use the [0-9] to get the additional characters.

Thanks again!
2,218
Posted By mikayla73
My file looks like this now word1_a123456 ...
My file looks like this now

word1_a123456
word1_a987654

It gives me the number, but also changes the entire line of the file to just have word1_a123456 as that line. I don't want to change...
2,218
Posted By mikayla73
find a multiple words on a line, plus the next 6 characters?
I plan to use sed in a script to replace a string. My problem is the last 6 characters of the word to be replaced can be different each time, plus it's not always in the same spot on the line so I...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 04:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy