in reply to Re^2: repeat data at one line and grep as pre-set format
in thread repeat data at one line and grep as pre-set format

You could avoid copying $1 if you use lookbehind, but there is that pesky problem of \s+ between the digit fields, which won't work with lookbehind (variable width rule). I couldn't tell by the OP's post whether there was a fixed number of spaces or not. Assuming only two spaces (or at least a known quantity of spaces) between the column fields, you could do something like this:

perl -pe "s/(?<=\d{8}\s\s\d{5})\s+/\n/g;" t.txt

Dave

Replies are listed 'Best First'.
Re^4: repeat data at one line and grep as pre-set format
by BrowserUk (Patriarch) on Jan 24, 2006 at 10:59 UTC

    You could use a combination of lookbehind and lookahead:

    perl -pe "s[(?<=\d{5})\s+(?=\d{8})][\n]g" t.txt

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.