I have a text with a compound list with a start date and a small variable text (a title). With grep can I move the date to the end? What?
If you show an example so that we can see what format the date is, maybe you get a working solution.
758 Text1 abcd bla blabla bla
1050 Text2 balska ababab abaababbb
1751 Text3 sljsda sbabab abababa
2020 Text4 ada daadfa adfafa dafaba b bababb
I wanted to transform like this
Text1 abcd bla blabla bla 758
Text2 balska ababab abaababbb 1050
Text3 sljsda sbabab abababa 1751
Text4 ada daadfa adfafa dafaba b bababb 2020
Vladan's solution works fine. Just one thing: if there's any formatting it'll be messed up.
Yep. If there is any local formatting at all, it'll disappear or – possibly worse – remain in place while the text gets shifted.
If your text contains local formatting, it'll need a script to do this safely.
Yes, of course I agree, but as I wrote before, I have proposed grep based on his example without thinking of possible variables that maybe there are in his text or maybe there aren't.
Peter surely will give you better solution but in the meantime try this grep:
This grep is based exclusively on the example you provided.
If there are other variables in your text, let us know with another example