10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi. I have to swap the first and the third word in all lines of a txt file using sed.
Separators between words are: any charachter, except intervall.
I hope, you'll understand what I want to do. my english is not so good, sorry for that:) (10 Replies)
Discussion started by: T720
10 Replies
2. Shell Programming and Scripting
Hi all,
I want to make an script using sed that removes everything between 'begin' (including the line that has it) and 'end1' or 'end2', not removing this line.
Let me paste an 2 examples:
anything before
any string begin
few lines of content
end1
anything after
anything before
any... (4 Replies)
Discussion started by: meuser
4 Replies
3. Shell Programming and Scripting
I have a file which is
DFDG
START
DSFDS
DSDS
XXX
END (VIO)
AADD
START
SDSD
FGFG
END
and I have to print the lines between START and END (VIO). In the files there are multiple places where START would be followed by END with few lines in between but I need to print only if START is... (18 Replies)
Discussion started by: pgbuddy
18 Replies
4. Shell Programming and Scripting
Hi all,
I have a file like
one two three for
five six seven eight
.....
Actually i need to append a label to the words that belong to the 2 column and get:
one two_label three for
five six_label seven eight
....
I was trying with sed inside vim but I can't figure out... (9 Replies)
Discussion started by: Dedalus
9 Replies
5. Shell Programming and Scripting
Hi, i need to delete every thing ecept sentences between known prases lets say
i have
Thu Dec 4 08:28:57 2008 : Auth: Login OK: (from client LINKSYS3 port 12 cli 001644fc4838)
i need information between Login OK: and ] (from what is vyce6220. between client and port between cli... (15 Replies)
Discussion started by: wrwe
15 Replies
6. Shell Programming and Scripting
Hello. There is something I can not manage : I want to swap the first word with the third one in every line. No file is given the input is read from the keyboard. I know I have to use sed, but it seems this is too complicated for me. Could you help me please ?
Thanks,
atticus (9 Replies)
Discussion started by: atticus
9 Replies
7. Shell Programming and Scripting
I've following sed command working fine -
sed '/search_pattern1/ !s/pattern1/pattern2/" file
Now, I want to search two patterns - search_pattern1 and search_pattern2 .
How can put these into above sed statement ?
Thanks in advance. (12 Replies)
Discussion started by: ajitkumar2
12 Replies
8. Shell Programming and Scripting
I currently use this bash for loop below to reverse a set of tokens, example "abc def ghi" to "ghi def abc" but in looking at various sed one liner postings I notice two methods to reverse lines of text from a file (emulating tac) and reversing letters in a string (emulating rev) so I've spent some... (1 Reply)
Discussion started by: markc
1 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have the following codes below that aims to delete every words between two pattern word. Say I have the files
To delete every word between WISH_LIST=" and " I used the below codes (but its not working):
#!/bin/sh
sed '
/WISH_LIST=\"/ {
N
/\n.*\"/ {... (3 Replies)
Discussion started by: Orbix
3 Replies
10. UNIX for Dummies Questions & Answers
so i have been trying to learn how to manipulate text on my own and have gotten stumped...
let's say i have a text file that says (highly simplified):
people ordinary
How would swap the order of the words..
I know i need to use sed and some kind of back reference but cannot make it... (2 Replies)
Discussion started by: urtherhoda
2 Replies