> Aéris writes:
> Le 17/09/2011 00:40, Bob Proulx a écrit :
[…]
>> * Secondly if the add-pre-nl.sh script handle multiple file
>> arguments then instead of \; use + so that it calls it fewer times
>> with as many file arguments as possible. It will be more efficient
>> that way.
Tom Furie wrote:
> Bob Proulx wrote:
> > Using sed is a good tool for this but if you want to append then you
> > should use the 'a' command.
> >
> > $ printf "one\ntwo\nthree\nfour\n" | sed '/two/a\
> > -> foo'
> > one
> > two
> > -> foo
> > three
> > four
>
> This doesn't quite wo
On Fri, Sep 16, 2011 at 12:58:08PM -0600, Bob Proulx wrote:
> Using sed is a good tool for this but if you want to append then you
> should use the 'a' command.
>
> $ printf "one\ntwo\nthree\nfour\n" | sed '/two/a\
> -> foo'
> one
> two
> -> foo
> three
> four
This doesn't quite wor
Hi Tom (and others)
>> Ok, I've got most of it. The last part is more of a bash problem I think
as
>> most of the files have spaces in them. Not my idea, it's how the files
were
>> delivered to me. :-(
>>
>> So the command line:
>> for i in `ls *.txt` ; do ./add-pre-nl.sh $i; done
>> does not cut
Aéris wrote:
> Le 17/09/2011 00:40, Bob Proulx a écrit :
> > Ah... Very good! An excellent suggestion! 'find' rocks! I will
> > note three things here however.
> >
> > * One is that the find will recurse down through a possibly deep
> > hierarchy of directories. It isn't an identical alternat
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Le 17/09/2011 00:40, Bob Proulx a écrit :
> Ah... Very good! An excellent suggestion! 'find' rocks! I will
> note three things here however.
>
> * One is that the find will recurse down through a possibly deep
> hierarchy of directories. It isn't
Aéris wrote:
> Le 16/09/2011 23:40, Bob Proulx a écrit :
> > If there are no *.txt files then the file glob won't be expanded,
> > nothing to expand it to, and then your shell script will get a literal
> > "*.txt" as an argument. If that minor point is important to you then
> > check that the file
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Le 16/09/2011 23:40, Bob Proulx a écrit :
> If there are no *.txt files then the file glob won't be expanded,
> nothing to expand it to, and then your shell script will get a literal
> "*.txt" as an argument. If that minor point is important to you th
Bonno Bloksma wrote:
> The last part is more of a bash problem I think as most of the files
> have spaces in them. Not my idea, it's how the files were delivered
> to me. :-(
>
> So the command line:
> for i in `ls *.txt` ; do ./add-pre-nl.sh $i; done
Eww.. Don't say `ls *.txt` there but just
On Fri, Sep 16, 2011 at 5:14 PM, Bonno Bloksma wrote:
>
>>> linbobo:~/sedtest# sed 's_\n\n_\n\n\n_' >> >new.txt linbobo:~/sedtest# less new.txt
>
>> You want to change the regexp here. In regular expressions '^' matches
> start of line and '$' matches end of line.
>> Your sed instruction above sho
Hi Tom (and others)
>> linbobo:~/sedtest# sed 's_\n\n_\n\n\n_' > >new.txt linbobo:~/sedtest# less new.txt
> You want to change the regexp here. In regular expressions '^' matches
start of line and '$' matches end of line.
> Your sed instruction above should be something like 's/^$/\n/',
or more g
Bonno Bloksma wrote:
> Have been experimenting some with it but...
>
> linbobo:~/sedtest# sed 's___' new.txt
> linbobo:~/sedtest# less new.txt
>
> And indeed I will see on that line instead of but...
>
> linbobo:~/sedtest# sed 's_\n\n_\n\n\n_' new.txt
> linbobo:~/sedtest# less new.txt
>
> Wil
> I have a bunch of files where I need an extra line after a code. So
> I need to change CRLF (or LF) to CRLFCRLF.
>
> Which toool can I use for that, I can't remember which tool is a good one
> for this and google is no help.
> I am not fluent in any of the programming languages but I do write b
On Fri, 16 Sep 2011 17:24:52 +0200, Bonno Bloksma wrote:
> Hi Camaleón,
>
>>> I have a bunch of files where I need an extra line after a code.
>>> So I need to change CRLF (or LF) to CRLFCRLF.
>>>
>>> Which toool can I use for that, I can't remember which tool is a good
>>> one for this and goo
On Fri, Sep 16, 2011 at 05:24:52PM +0200, Bonno Bloksma wrote:
> linbobo:~/sedtest# sed 's_\n\n_\n\n\n_' new.txt
> linbobo:~/sedtest# less new.txt
You want to change the regexp here. In regular expressions '^' matches
start of line and '$' matches end of line. Your sed instruction above
should be
Hi Camaleón,
>> I have a bunch of files where I need an extra line after a code.
>> So I need to change CRLF (or LF) to CRLFCRLF.
>>
>> Which toool can I use for that, I can't remember which tool is a good
>> one for this and google is no help.
>> I am not fluent in any of the programming langua
On Fri, 16 Sep 2011 17:01:40 +0200, Bonno Bloksma wrote:
> I have a bunch of files where I need an extra line after a code.
> So I need to change CRLF (or LF) to CRLFCRLF.
>
> Which toool can I use for that, I can't remember which tool is a good
> one for this and google is no help.
> I am not f
Hi,
I have a bunch of files where I need an extra line after a code. So I
need to change CRLF (or LF) to CRLFCRLF.
Which toool can I use for that, I can't remember which tool is a good one
for this and google is no help.
I am not fluent in any of the programming languages but I do write bash
scr
18 matches
Mail list logo