Re: Text Manipulation/Replacement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



| From: Patrick O'Callaghan <pocallaghan@xxxxxxxxx>

| Splitting hairs is essential to programming. Do What I Mean hasn't been
| invented yet.

Splitting hairs: DWIM has been invented.  It was part of InterLISP
perhaps 25 years ago.

http://www.catb.org/~esr/jargon/html/D/DWIM.html
http://ars.userfriendly.org/cartoons/?id=20011121

I don't think that it lived up to its name.



Back to the original problem:

The sed script is correct but it isn't the first one that comes to my
mind since sed's hold buffer is arcane (to me).

This ed command seems easy and ought to work:
  g/^,/ .-1,.j
[Translation: for all lines that start with ",", join the previous and
current line.]

It will fail if the first line starts with ",".  This next version
would work if you are sure that the file has more than one line:
  2,$g/^,/ .-1,.j

It all depends on what tools you are used to.

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux