Re: [Tutor] delete strings from specificed words

2018-01-11 Thread Cameron Simpson
On 11Jan2018 12:16, YU Bo wrote: Hi, Hi, On Thu, Jan 11, 2018 at 11:40:35AM +1100, Cameron Simpson wrote: Do you have the text as above - a single string - or coming from a file? I'll presume a single string. En.., the text is multi-string from str(something) within python. That's a si

Re: [Tutor] delete strings from specificed words

2018-01-11 Thread YU Bo
Hi, On Thu, Jan 11, 2018 at 11:40:35AM +1100, Cameron Simpson wrote: On 09Jan2018 22:20, YU Bo wrote: The text i will working as follow: ```text [...] diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index a789f952b3e9..443892dabedb 100644 [...] +++ b/tools/perf/util/util.c [.

Re: [Tutor] delete strings from specificed words

2018-01-10 Thread Cameron Simpson
On 09Jan2018 22:20, YU Bo wrote: The text i will working as follow: ```text [...] diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index a789f952b3e9..443892dabedb 100644 [...] +++ b/tools/perf/util/util.c [...] ``` In fact, this is a patch from lkml,my goal is to design a ker

Re: [Tutor] delete strings from specificed words

2018-01-10 Thread YU Bo
Hi, On Wed, Jan 10, 2018 at 10:37:09AM +0100, Peter Otten wrote: YU Bo wrote: index 45a63e0..3b9b238 100644 ... ``` I want to delete string from *diff --git* to end, because too many code is here Use str.split() or str.partition() and only keep the first part: text = """The registers rax, r

Re: [Tutor] delete strings from specificed words

2018-01-10 Thread Peter Otten
YU Bo wrote: > ```text > The registers rax, rcx and rdx are touched when controlling IBRS > so they need to be saved when they can't be clobbered. > > diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h > index 45a63e0..3b9b238 100644 > ... > ``` > I want to delete string from *diff

Re: [Tutor] delete strings from specificed words

2018-01-10 Thread YU Bo
Hi, First, thank you very much for your reply. On Tue, Jan 09, 2018 at 10:25:11PM +, Alan Gauld via Tutor wrote: On 09/01/18 14:20, YU Bo wrote: But, i am facing an interesting question.I have no idea to deal with it. I don;t think you have given us enough context to be able to help muc

Re: [Tutor] delete strings from specificed words

2018-01-09 Thread Alan Gauld via Tutor
On 09/01/18 14:20, YU Bo wrote: > But, i am facing an interesting question.I have no idea to deal with it. I don;t think you have given us enough context to be able to help much. WE would need some idea of the input and output data (both current and desired) > [PATCH] perf tools: Fix copyfile_of

[Tutor] delete strings from specificed words

2018-01-09 Thread YU Bo
Hi, I am learning python to reslove issue,which make happy:) But, i am facing an interesting question.I have no idea to deal with it. The text i will working as follow: ```text [PATCH] perf tools: Fix copyfile_offset update of output offset We need to increase output offset in each iteration