Groups
Groups
Sign in
Groups
Groups
Ansible Project
Conversations
About
Send feedback
Help
removing blank lines after all lines start with specific string
21 views
Skip to first unread message
Shlomit Afgin
unread,
Oct 18, 2018, 3:47:03 AM
10/18/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
HI,
Is there any way to remove from a file, all blank lines that exist after line start with specific string?
for example:
Remove all blank lines after lines start with XXX1
XXX1bla b
la bla
hjshfgdfg
gdfsgdsgdf
gsdfgd
XXX1 blu bluu blu
dfjgljfd
gfdgds
will be:
XXX1bla b
la bla
hjshfgdfg
gdfsgdsgdf
gsdfgd
XXX1 blu bluu blu
dfjgljfd
gfdgds
aakanks...@webdunia.net
unread,
Oct 18, 2018, 4:48:45 AM
10/18/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
you can write shell script for that and put that code in playbook.
Dick Visser
unread,
Oct 18, 2018, 11:23:16 AM
10/18/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
- replace:
path: my_file
regexp: '(XXX1.*)$\s+'
replace: '\1'
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
ansible-proje...@googlegroups.com
.
> To post to this group, send email to
ansible...@googlegroups.com
.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/a24ccd71-c5f7-4fc3-8d8e-c9ceda4d59b4%40googlegroups.com
.
> For more options, visit
https://groups.google.com/d/optout
.
Reply all
Reply to author
Forward
0 new messages