From: Hongyi Zhao on 21 Feb 2010 20:57 Hi all, Consider the following sentence: you're my friend, bla, he's my another friend. If I want to use the bla as the awk's field-separator to do some text manipulate, is it possible or not? -- ..: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.
From: Barry Margolin on 21 Feb 2010 22:03 In article <oqo3o5p84e7igl8560k508o3sfhfh99n0c(a)4ax.com>, Hongyi Zhao <hongyi.zhao(a)gmail.com> wrote: > Hi all, > > Consider the following sentence: > > you're my friend, bla, he's my another friend. > > If I want to use the bla as the awk's field-separator to do some text > manipulate, is it possible or not? You can use any regular expression as the field separator. awk -F'bla' ... -- Barry Margolin, barmar(a)alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***
From: Hongyi Zhao on 21 Feb 2010 22:17 On Sun, 21 Feb 2010 22:03:00 -0500, Barry Margolin <barmar(a)alum.mit.edu> wrote: >You can use any regular expression as the field separator. > >awk -F'bla' ... Good, thanks. I should test it first. -- ..: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.
|
Pages: 1 Prev: awk: use { or } as the field-separator. Next: Fun with the $SHELL |