Advertisement

05.08.2008 at 12:42PM PDT, ID: 23387410 | Points: 125
[x]
Attachment Details

Option in VS2005 to save files with LF

In VS2005 I can save a file with LF instead of CR/LF. But is there a way to configure VS2005 so it always forces a file to be saved with LF even if the file had CR/LF for all lines when it was opened (i.e., without me needing to select the pulldown)?
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: ESQuicksall
Question Asked On: 05.08.2008
Participating Experts: 3
Points: 125
Views: 0
Translate:
Loading Advertisement...
05.08.2008 at 09:47PM PDT, ID: 21530444

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 12:55AM PDT, ID: 21531008

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 08:53AM PDT, ID: 21534121

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 09:15AM PDT, ID: 21534324

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 09:38AM PDT, ID: 21534531

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 09:42AM PDT, ID: 21534562

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 09:44AM PDT, ID: 21534583

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 09:52AM PDT, ID: 21534661

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 09:56AM PDT, ID: 21534691

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 09:57AM PDT, ID: 21534700

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 10:04AM PDT, ID: 21534745

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 10:10AM PDT, ID: 21534791

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 10:13AM PDT, ID: 21534827

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 10:23AM PDT, ID: 21534901

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • Automotive
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Displays / Monitors
  • Handhelds / PDAs
  • Components
  • Peripherals
  • Laptops/Notebooks
  • Servers
  • Misc
  • Apple
  • Embedded Hardware
  • Networking Hardware
  • Storage
  • Desktops
  • New Users
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMware
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Virtualization
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • Web Computing
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Consulting
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMware
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Automation
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Web Services
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Web Computing
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Lounge
  • Business Travel
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
  • Automotive
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.08.2008 at 09:47PM PDT, ID: 21530444

Rank: Guru

there is not reason for providing such needs. So I bet there is no standard way to achieve what you like.

Regards
Friedrich
 
05.09.2008 at 12:55AM PDT, ID: 21531008

Rank: Sage

If this is so code can be compiled on Unix platforms you can always use the dos2unix tool to modify line endings.
http://linuxcommand.org/man_pages/dos2unix1.html
 
05.09.2008 at 08:53AM PDT, ID: 21534121
not being a user of VS, here is what I would do:


(1) install Perl on your windows machine

(2) use Perl to take any file, or batch of files, and convert all the CR/LF's to LF's...  or vice versa.


if you want more assistance with either (1) or (2) let me know.
 
05.09.2008 at 09:15AM PDT, ID: 21534324

Rank: Guru

One does not need Perl for it, every scripting langauge could be used for such kind of tasks. I just pointed out that there will be no option "build-into" MSVC to achieve that. One could e.g write a small com-add-in for that....

Regards
Friedrich
 
05.09.2008 at 09:38AM PDT, ID: 21534531

Rank: Sage

>> One does not need Perl for it
Agreed... it's a bit overkill; installing a scripting language (I have nothing against Perl) just for this, especially when you can just download dos2unix and unix2dos...
http://www.bastet.com/
 
05.09.2008 at 09:42AM PDT, ID: 21534562
I already have programs to remove the CR's. VS has an option to save as LF but it is on a per file basis. I was looking for a default option so that when I'm editing any other CR/LF files it will automatically save as LF. Since that option doesn't exist I'll just live with it.
 
05.09.2008 at 09:44AM PDT, ID: 21534583
FYI, if the file is already a unix file (LF style) then VS2005 will always save it in that form.
 
05.09.2008 at 09:52AM PDT, ID: 21534661

Rank: Sage

>> Since that option doesn't exist I'll just live with it.
There is no such option but you could set up an external tool to do it using one of the programs discussed here. For example, if you know all your source is in the same folder you could set up a tool to process all *.c *.cpp *.h files in that folder. There are variables you can use to facilitate this, such as $(targetdir). Ok, so you'd still have to select a menu option but you'd only need do it once after your editing session. You could even set it up as a hot-key combination to make it really easy. I have a similar mechanism set up to open vim and display the current file at the line it's currently at in VS because I prefer the editing facilities in vim. I use CTRL-` to fire this up. I'm sure you can figure out a way to do what I've suggested here.
 
05.09.2008 at 09:56AM PDT, ID: 21534691
It is not a big deal. It only needs to be done once and when I edit it will keep the LF's. The reason for looking for the default was because when I pickup some new files I don't have to know if they are CR/LF or LF files.
 
05.09.2008 at 09:57AM PDT, ID: 21534700

Rank: Sage

BTW: You didn't say why you wanted to do this... are the line endings significant for you?
 
05.09.2008 at 10:04AM PDT, ID: 21534745
In some cases they are. The target system's Makefile can't have CR's and vi shows ^M which annoys some people.

You may wonder why I'm not strictly on the target system. The reason is because my code is totally system independent. It lives on Windows where I do most of my editing and testing. I have a button that copies the changed files over to the target system where I build and test. So the Makefile for that system must not have CRs and sometimes I like to edit (or checkin) on the target system. Since VS doesn't care if the file ends with LF only then it is best to keep it that way. Now, every now and then I need to bring in another file that someone created on Windows but didn't know about this LF thing. Granted there are lots of different ways to handle this, one of which is to d2u the file at the time it is being copied but I wanted to ask the question just incase VS had that option.
 
05.09.2008 at 10:10AM PDT, ID: 21534791

Rank: Sage

>> In some cases they are. The target system's Makefile can't have CR's and vi shows ^M which annoys some people.
Yes, it annoys me too :) You know that most xfer clients can be configured to automatically remove these though, right?

>> You may wonder why I'm not strictly on the target system.
Not at all, I target about 10 different platforms, but I write the code mainly on Windows because I like the VS IDE.

>> So the Makefile for that system must not have CRs and sometimes I like to edit (or checkin) on the target system
Have you ever looked at SCons? It's a platform independent make system. It's very simple to convert Makefiles to SCons scripts. The SCons framework is, itself, python based so it's very rich. You might want to try looking at it as the time to convert Makefiles shouldn't be too long but then you'll have a build mechanism that will work on all platforms, greatly reducing your makefile maintenance overhead. It also have no care about line endings :)
http://www.scons.org/

 
05.09.2008 at 10:13AM PDT, ID: 21534827
I transfer with xcopy /m.

My company has a make system and would not want me to change it but I'll bring it up since it has some advantages.
 
05.09.2008 at 10:23AM PDT, ID: 21534901

Rank: Sage

>> I transfer with xcopy /m.
Samba share? I think, but I might be wrong, but I think that Samba can be configured to do this translation automatically... but you'd have to check the man pages for smb.conf or as in the appropriate TA. If not you could always switch to using something like winscp, which will do it for you.

>> My company has a make system and would not want me to change it but I'll bring it up since it has some advantages.
Understood... we too have a build system but I managed to get it working with SCons with minimal effort (in fact simpler than the way it would normally interface because of the x-platform nature of it).
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628