Text Manipulation/Replacement
Mark Haney
mhaney at ercbroadband.org
Tue Sep 23 12:27:37 UTC 2008
Ubence Quevedo wrote:
> Hello All,
>
> I've used pdftotext to convert a pdf document to text and then used a
> combination of grep and awk to single out data and replace formatting
> that I didn't need.
>
> The output data eventually looks like this:
> 12,123456789
> ,0987654321
>
> But I want it to look like this:
> 12,123456789,0987654321
>
> I've tried many different things with awk, but I can't get it replace \r, with just a ,
>
> Does anyone have any ideas on how I can accomplish this, or at least give me an idea of what I'm doing wrong?
>
> Thanx in advance for any help.
>
> -Ubence
>
>
I'm curious to know if the first line of data ends with a \n? If so,
I'd bet searching for it and removing it would fix that. The \r is just
a simple return char, this looks like a Return with Newline which
grepping for \r won't catch.
--
Libenter homines id quod volunt credunt -- Caius Julius Caesar
Mark Haney
Sr. Systems Administrator
ERC Broadband
(828) 350-2415
Call (866) ERC-7110 for after hours support
More information about the ubuntu-users
mailing list