Use awk to turn character to newline then scan output
i have a datafile (data.txt) that has the following data:
below is the code im currently using to get what I want:
This code works for my purposes. However, i want to do the same exact thing with awk. and hopefully avoid havin to make 3 external calls to system utilities.
basically, i want awk to:
1. turn all instances of backticks to new lines
2. then from the output of step 1, grab only the text between the lines #Beginner and #Ender
3. then i want it to exclude all lines it finds that contain any of the following strings openssl|RRB|#Feb|echo
Incredible ... there's no #Beginner nor #Ender string in the sample data. How do you expect people to come up with a reasonable proposal if they can't seriously test it?
EDIT: Nor is any of the to-be-suppressed strings in there.
Are you building elaborate rube goldberg schemes in the hope of deterring people from using your code again? Unless the 'openssl blah blah' is run on some other machine - somewhere beyond your clients' control - this is entirely pointless, as all they have to do is read it to see what's going on.
Last edited by Corona688; 03-31-2017 at 04:24 PM..
I have a file which comes every day and the file data look's as below.
Vi abc.txt
a|b|c|d\n
a|g|h|j\n
Some times we receive the file with only a new line character in the file like
vi abc.txt
\n (8 Replies)
Hi all..
I have a text file which looks like below:
abcd
efgh
ijkl
(blank space)
I need to remove only the last (blank space) from the file. When I try wc -l the file name,the number of lines coming is 3 only, however blank space is there in the file.
I have tried options like... (14 Replies)
I have a file (pema)with a single long record which i have to break up into multiple lines
Input
s1aaaaaaaaaaaaaaaaaaaaaaas1bbbbbbbbbbs1cccccccccc
Output
s1aaaaaaaaaaaaaaaaaaaaaaa
s1bbbbbbbbbb
s1cccccccccc
m planning to do it by replacing s1 by \ns1 \n is the new line character
i... (5 Replies)
Hi guys,
I'am new at this forum as well as with unix.
currently iam trying to create a unix script that will write certain string of words into a file depending on certain conditions apparently i am having problems in terms of writing into the file using the awk. it returns an error ... (0 Replies)
Removed.
My question does not make sense. and SED does see the last newline character.
But I still have a question:
How to remove the last newline character(the newline character at the end of last line) using SED?
---------- Post updated 05-01-11 at 10:51 AM ---------- Previous update was... (7 Replies)
I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex )
---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1
-- After the 1st occurrence of 1 string1 till the 1st occurrence of... (4 Replies)
hi,
I have a for loop where in I write some file name to another file.
I want to write all the filenames to another without any newlines. how can i avoid getting new lines with echo?
Thanks,
Srilaxmi (2 Replies)
hi,
I want to print the below lines
"Message from bac logistics
The Confirmation File has not been received."
When i give like this in the code
"Message from bac logistics\n The Confirmation File has not been received."
It is giving only
Message from bac logistics\n The... (9 Replies)
Hi,
I am trying to write a script to prepare some text for use as web content.
What is happening is that all the newlines in the textfile are ignored, so I want
to be able to replace/add a few characters so that for a file containg:
This is line 1.
This is line two.
This is line four.... (1 Reply)