Author Topic: notepad++  (Read 340 times)

0 Members and 1 Guest are viewing this topic.

Offline Yendor

  • Member
  • *
  • Posts: 17
    • Wanaka Weather
notepad++
« on: September 09, 2017, 03:40:55 AM »
I have used notepad++ to edit my files for website since i started. For some random reason when I was trying to fiddle with my Saratoga files I have managed to get some of them saved all on one line when opened in notepad++. Nothing I have tried has brought back the original files which displayed nicely with line breaks. Anyone have any ideas what I have done?

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1104
    • Support site Leuven Template and scripts
Re: notepad++
« Reply #1 on: September 09, 2017, 06:07:40 AM »
I have used notepad++ to edit my files for website since i started. For some random reason when I was trying to fiddle with my Saratoga files I have managed to get some of them saved all on one line when opened in notepad++. Nothing I have tried has brought back the original files which displayed nicely with line breaks. Anyone have any ideas what I have done?
1. Maybe you set the end-of-line to something else at
notepad++ => Settings => preferences => New document.
That should be "Windows"
You can convert that long line back to multiple lines by choosing in
notepad++ => Edit => EOL conversion and choose "windows" there.

2. Another way it can be one long line in a php or txt file is setting the wrong upload type in your FTP program.  Where this is set is different for all FTP programs. Normally it should be set to ASCII for php and txt files and  Binary for .png and .gif files.
Most FTP programs has settings which files should be uploaded as ASCII and which as binary.

Succes, Wim
Vantage VUE with a WLIP used for https://weer.sluispark.be/
Vantage VP2 with a USB logger/Meteobridge for https://www.weerstation-herent.be/

Offline Yendor

  • Member
  • *
  • Posts: 17
    • Wanaka Weather
Re: notepad++
« Reply #2 on: September 09, 2017, 03:42:18 PM »
Wim,

Thank-you for your reply. I had consulted google and checked the EOL setting (it appears to be set to windows). I have looked at my ftp program (Filezilla) and it is set to auto which apparently treats php as ascii and png and gif as binary. I tried to save the files again ensuring the eol was set windows but it has made no difference. The file shows as being 18,247 long 1 line windows (CR LF)  UTF-8. I am reasonably sure I have not played with any of my notepad or ftp settings and have only done what I would normally do when saving a file. That said computers are very picky and it is possible I have managed to change something.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1104
    • Support site Leuven Template and scripts
Re: notepad++
« Reply #3 on: September 10, 2017, 03:26:11 AM »
Wim,

Thank-you for your reply. I had consulted google and checked the EOL setting (it appears to be set to windows). I have looked at my ftp program (Filezilla) and it is set to auto which apparently treats php as ascii and png and gif as binary. I tried to save the files again ensuring the eol was set windows but it has made no difference. The file shows as being 18,247 long 1 line windows (CR LF)  UTF-8. I am reasonably sure I have not played with any of my notepad or ftp settings and have only done what I would normally do when saving a file. That said computers are very picky and it is possible I have managed to change something.
It would really help if you posted that file as a zip, so I can take a look.

Another quick solution:  Open the file with Wordpad and save that file after opening.
Wordpad should make a full "cr/lf"   of every single "lf"   and single "cr"

Wim
Vantage VUE with a WLIP used for https://weer.sluispark.be/
Vantage VP2 with a USB logger/Meteobridge for https://www.weerstation-herent.be/

Offline Yendor

  • Member
  • *
  • Posts: 17
    • Wanaka Weather
Re: notepad++
« Reply #4 on: September 10, 2017, 04:24:29 AM »
Wim,

I tried to send the file but did not realise that I could zip it so the file could be sent. It was rejected as I tried to send the php file. I tried the word pad option and still had no joy. There is something I am missing as it seems to be a simple thing to do. Thank you for your patience and help.

Offline corwyyn

  • Forecaster
  • *****
  • Posts: 328
  • Far, far east Mesa, AZ
    • Sleeping Saguaros Weather  Mesa, AZ
Re: notepad++
« Reply #5 on: September 10, 2017, 05:53:01 AM »
Saw this and it got me curious so I did some google searching, here is what I found:

Open the current version in notepad++
Go to Search>Replace and in the 'Search Mode' section select 'extended'
In the 'Find' box type a double-slash //
in the 'Replace' box type \n// (\n adds a line feed in front of the double-slash)
Click 'Replace All'

At this point you'll have all of the lines returned but may need to edit the file back to the state it was originally in.  I noticed that lines 174-175 still run out quite a bit and probably need some extra editing, but that should be easy enough once you get the file back to a normal state.

Hopefully this will get you sorted out, and once you have the files back to a good state make a backup of everything so you don't have to go thru all this again! :D


Kevin
AD5VG
Blitzortung station 1042

Offline Yendor

  • Member
  • *
  • Posts: 17
    • Wanaka Weather
Re: notepad++
« Reply #6 on: September 11, 2017, 04:35:44 AM »
Corwyyn,

Thanks for help. I had the original file to compare but was hoping not to have to re-enter all my changes. This glitch occurred whilst I was was changing a few things to see what they looked like. Point taken about backing up before meddling. Your tip restored some of the original state but definitely not all. I had to spend a little time getting my file matching the original template file (with my changes). I am still none the wiser as to what I did to cause the issue but it is all learning.

 

anything