Search Results

Search: Posts Made By: dockline
3,110
Posted By dockline
I did alister. I may be doing something...
I did alister. I may be doing something incorrectly, but in my tests I just get a blank text document returned.
3,110
Posted By dockline
Thank you for the input, and my apologies if I'm...
Thank you for the input, and my apologies if I'm slow on getting it.

bartus11, I can see now how your code works:

perl -pe 's/THE GREEN TABLE/\n$&/||s/\n/ /;END{print "\n"}' fileIt removes line...
3,110
Posted By dockline
It varies - but it is always a 2 or 3 word...
It varies - but it is always a 2 or 3 word phrase. In these examples I used THE BLUE TABLE and THE GREEN TABLE.

When I run the code it is removing all line breaks in the document, not just...
3,110
Posted By dockline
Try calling the first paragraph THE BLUE TABLE. ...
Try calling the first paragraph THE BLUE TABLE. When I run it - it is doing the entire document.
3,110
Posted By dockline
Getting closer. That removed the line breaks...
Getting closer. That removed the line breaks from the entire document, rather than just the line breaks after the match - "THE GREEN TABLE".
3,110
Posted By dockline
I'm using: perl -pe 's/^THE GREEN...
I'm using:
perl -pe 's/^THE GREEN TABLE$/\n$&/||s/\n/ /;END{print "\n"}' testfile.txt

However, the file testfile.txt appears unchanged.
3,110
Posted By dockline
perl -pe 's/^[[:upper:] ]+$/\n$&/||s/\n/...
perl -pe 's/^[[:upper:] ]+$/\n$&/||s/\n/ /;END{print "\n"}' file

The text to be matched with not always be upper case. How can I specify specific text to be matched?
3,110
Posted By dockline
Remove line breaks after a match
I need to remove all line breaks in a document after a match, until there is a blank line.

Example below, after the match "THE GREEN TABLE" remove line breaks until a blank line. Then, after the...
9,028
Posted By dockline
This data is updated several times a day, every...
This data is updated several times a day, every day, so it must be automated. I can program SED to replace often used words and phrases with the right capitalization. Words like ATLC and Atlantic...
9,028
Posted By dockline
I'm using Centos 6.2 on a web server. ...
I'm using Centos 6.2 on a web server.
Shell/bin/bash
SED (or an alternative) would be run on a schedule using cron.

I understand "sentence" isn't a programming term - I simply mean the normal...
9,028
Posted By dockline
SED (or other) upper to lowercase, with first letter of first word in each sentence uppercase
The title pretty much defines the problem. I have text files that are all in caps. I would like to convert them to lowercase, but have the first letter of the first word in each sentence in...
1,175
Posted By dockline
Birei, Thank you for a wonderfully simple...
Birei,

Thank you for a wonderfully simple fix. The .* solution works great.

Life is calmer again....

Thank you again,

Keith
1,175
Posted By dockline
SED script needs tweak
I have a SED script that has worked for years, but broke today due to a new variable in a remote file. This is the part of the script that now won't work:

sed...
Showing results 1 to 13 of 13

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