Re: [gedit-list] having problems with gedit adding blank lines to files...



John,

ooooh, so you're on Windows.  You should have mentioned that in your original post.  :)  Windows uses two characters (a carriage return + line feed) to represent line endings, whereas Unix-based operating systems, where gedit usually runs, use just one (a line feed).  My guess is that gedit is transforming the line endings somehow (perhaps from CR + LF to LF + LF), but it's hard to say without more investigation.  I myself don't use Windows so I can't easily help more.  If someday you switch to a free operating system and run a free spreadsheet app such as Gnumeric or LibreOffice Calc then people on this list will probably be in a much better position to assist you.  But that's up to you.  :)

adam

On Mon, May 6, 2013 at 4:47 PM, John Whitney <jwhitney petroak com> wrote:

Adam,

 

Thanks for the reply,

 

Since I’m running on Windows 7 and the Command Prompt states that “‘grep’ is not recognized as an internal or external command…” , I’m not able to do the test you suggested.

 

I really don’t think Excel is placing the extra lines in the file. Maybe the program that created the files initially might have put in some extraneous hidden character that gedit interpreters as a line return so shows the blank line when the file is read in and then saves it out as a blank line. Then Excel imports the file with the blank lines. However when I go through and remove the blank lines in Excel, and then save the file out as text to reopen in gedit only to see the blank lines reappear, you can understand why I feel that gedit is putting blank lines into files that didn’t have blank lines to begin with.

 

Is there a Windows version grep that I could us to follow your procedure to test this further.

 

Thanks,

 

John

 

From: Adam Dingle [mailto:adam medovina org]
Sent: Sunday, May 05, 2013 8:25 AM
To: John Whitney
Cc: gedit-list gnome org
Subject: Re: [gedit-list] having problems with gedit adding blank lines to files...

 

John,

 

I suspect that Excel, not gedit, is adding the blank lines.  Here's how you can tell for sure.  This command

 

$ grep -c "^\s*$" FILENAME

 

will print the number of blank lines in a file.

 

So you can do this:

 

1. Use the command above to count blank lines in the file.

2. Run gedit on the file.

3. Run the command above to count blank lines again.

 

If you do this, does the number of blank lines change from steps 1 to 3?

 

adam


On Wed, Apr 3, 2013 at 3:51 PM, John Whitney <jwhitney petroak com> wrote:

Hello,

 

I’ve been using gedit to look at and modify large txxt files (~ 1,000,000 lines). However I’ve discovered a problem with gedit adding blank lines to files when opened. For example opened a file, saved, opened it in Excel, search for blank lines and found many, removed blank lines using macro in Excel and saved the file. Opened file again in gedit and blank lines reappear, where when saved back out from gedit, the blank lines appear in Excel again.

 

Has this problem been reported? Is there a solution? Or is there something going on in Excel? (I’ve noticed that I’m seeing data appear in the file in places where data should not be – in a known blank section.)

 

Thanks for any help.

 

John

 

Click here to report this email as spam.



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