-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It is always the simple things...

I had to run dos2unix on all the files before sed would work as
expected.  A hexeditor can be a wonderful thing.

Basically
find /path/to/files -type f -exec dos2unix \{\} \;
find /path/to/files -type f -exec sed -i "s/,,$/,/" \{\} \;
find /path/to/filestype -type f -exec unix2dos \{\} \;

Thanks for the replies.

Cheers

Gustin Johnson wrote:
> - gpg control packet
> I have a client who has mysteriously damaged a whole bunch of files.
> Basically, there are 2300 files in a directory and sub-directories,
> which are comma  delimited.  Somehow a bunch of files had an extra comma
> added at the end of some lines.  What I need to do is to remove double
> commas ",," from the _end_ of some lines in each file (there are double
> commas in the middle of the line that must be untouched).
> 
> This screams sed  to me, but I am missing something, since I cannot seem
> to find the regex incantation that will find two commas at the end only.
> 
> It seemed simple, but then I am used to vim syntax (:%s/,,$/,/g), which
> normally also works in sed for me.
> 
> Any help would be appreciated.
> 
> Cheers,

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFNsXIwRXgH3rKGfMRAtFBAJ9rQDhdSHyRzAAQ9Mroig07cr+ZQQCdHC4P
0FyMm9epuXM+dexVqcJGg1I=
=aNt6
-----END PGP SIGNATURE-----

_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to