Re: Replacing the first line of a text file

2014-02-03 Thread Uri Guttman
On 02/03/2014 09:05 PM, Shawn H Corey wrote: On Mon, 03 Feb 2014 20:50:17 -0500 Uri Guttman wrote: Is there a way to replace the entire line with the new, shorter one? that is a unix problem and can't be done in any language. It's not even a UNIX problem. Windows and BSD have it too. It is

Re: Replacing the first line of a text file

2014-02-03 Thread Shawn H Corey
On Mon, 03 Feb 2014 20:50:17 -0500 Uri Guttman wrote: > > Is there a way to replace the entire line with the new, shorter > > one? > > that is a unix problem and can't be done in any language. It's not even a UNIX problem. Windows and BSD have it too. It is an artifact of how files are create

Re: Replacing the first line of a text file

2014-02-03 Thread Uri Guttman
On 02/03/2014 08:12 PM, SSC_perl wrote: I'm having a problem with the script below. I want to alter just the first line of a CSV file, removing the prefix "tag_" from each value in that line. However, because the new line is shorter than the original, the script is only over-writing part of the

Replacing the first line of a text file

2014-02-03 Thread SSC_perl
I'm having a problem with the script below. I want to alter just the first line of a CSV file, removing the prefix "tag_" from each value in that line. However, because the new line is shorter than the original, the script is only over-writing part of the original line (exactly the num

Re: regex headache

2014-02-03 Thread Jim Gibson
On Feb 3, 2014, at 12:30 PM, Paul Fontenot wrote: > Hi, I am attempting to write a regex but it is giving me a headache. > > I have two log entries > > 1. Feb 3 12:54:28 cdrtva01a1005 [12: 54:27,532] ERROR > [org.apache.commons.logging.impl.Log4JLogger] > 2. Feb 3 12:54:28 cdrtva01a1005 [12:

regex headache

2014-02-03 Thread Paul Fontenot
Hi, I am attempting to write a regex but it is giving me a headache. I have two log entries 1. Feb 3 12:54:28 cdrtva01a1005 [12: 54:27,532] ERROR [org.apache.commons.logging.impl.Log4JLogger] 2. Feb 3 12:54:28 cdrtva01a1005 [12: 54:27,532] ERROR [STDERR] I am using the following "^\w+\s+\d{1,2