The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 08-15-2007
caddyjoe77 caddyjoe77 is offline
Registered User
  
 

Join Date: Apr 2005
Posts: 40
deleting newline characters but not the "true" \n character

hi, i have a file that has about 4500 rows. this was an old microsoft access databse and what i am trying to do is take out the old extra \n newline characters but not take out the "true" newline character. I will explain.


i was trying to write a regular expression, but that was not working so i thought PERL would be the best option. The collums are seperated by commas.

Here is the dataset that i am working against.

144,20050892.0, Replacement of IN-FOCUS projector-Bldg 123, Replace malfunctioning In-Focus projector with new one.,- In-Focus projectors are used to project slideshows and other pertinent data to fron mountred screens.

- Intermittent power up problem, kicks on and off. This project was originally in Sept 2001.
- Bulbs have been replaced when it does work it is barely readable.,Infocus LP 640 XGA LCD Multimedia Projector $1699 EA


www.infocus.com,2005-09-29 00:00:00,2005-10-29 00:00:00,Joe Blow user
my phone number 5551212,5,0,3,None,,1,2005-10-12 00:00:00,C

Pretty much i need to remove the extra \n newline characters without removing the end one. This is what the dataset should look like.

144,20050892.0, Replacement of IN-FOCUS projector-Bldg 123, Replace malfunctioning In-Focus projector with new one.,- In-Focus projectors are used to project slideshows and other pertinent data to fron mountred screens. - Intermittent power up problem, kicks on and off. This project as originally in Sept 2001. - Bulbs have been replaced when it does work it is barely readable.,Infocus LP 640 XGA LCD Multimedia Projector $1699 EA
www.infocus.com,2005-09-29 00:00:00,2005-10-29 00:00:00,Joe Blow user my phone number 5551212,5,0,3,None,,1,2005-10-12 00:00:00,C

The fist column, in this case is 144, and they are numbered sequentially. So the next one would be 145.

can i do this with standard UNIX regular expressions or would PERL be better?

Thanks