![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to join lines | glamo_2312 | UNIX for Dummies Questions & Answers | 8 | 09-16-2008 04:17 AM |
| trim lines | melanie_pfefer | Shell Programming and Scripting | 6 | 03-26-2008 07:25 AM |
| How to count lines - ignoring blank lines and commented lines | kthatch | UNIX for Dummies Questions & Answers | 6 | 05-25-2007 01:21 AM |
| delete blank lines or lines with spaces only | vascobrito | UNIX for Dummies Questions & Answers | 3 | 01-13-2004 07:36 AM |
| join two lines together | tine | Shell Programming and Scripting | 4 | 12-12-2003 12:34 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Quote:
if u want to use shell script then do In shell script #!/bin/sh SCRIPT_DIR/run_cmd_.sh 192.131.58.35 uname pass $line | grep -v "Enter command:" >> REPORT_DIR/file.TMP sed '/^\s*$/d' /home/rahul/jatin/REPORT_DIR/file.TMP > REPORT_DIR/file.LOG |
|
||||
|
if u copy file from windos try this command
dos2unix filename grep -v ^$ filename here is my output DELETE:MD:TM,432350214576013; RESP:940120105; DELETE:MD:TM,432350415547447; RESP:940120105; SET:NOK:TM,432350110811018:T22,0; RESP:11000999; SET:MD:TM,4323500223734641; RESP:0; SET:NOK:TM,432350220813251:BAIC,1; RESP:0; SET:MD:TM,4323502142003351; RESP:0; DELETE:MD:TM,432350415283715; RESP:0; DELETE:MD:TM,432350415434001; RESP:0; SET:MD:TRIM,989370025055:LANG,English; RESP:0; DELETE:MD:TM,432350041977269:TRIM,989371036084;; RESP:940120105; SET:MD:TM,432350214483040; RESP:0; DELETE:MD:TM,432350021443483:TRIM,989362585071; RESP:0; |
|
||||
|
Okay i think I found why its not working. I did dos2unix filename. But still no outcome. Later i check the file with VI. I found-
DELETE:MD:TM,432350214576013;^M ^M RESP:940120105;^M DELETE:MD:TM,432350415547447;^M ^M RESP:940120105;^M SET:NOK:TM,432350110811018:T22,0; ^M RESP:11000999;^M ^M is creating problem !!! please make your suggestion |
|
||||
|
Code:
sed '/^\s*^M/d' file |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| awk, awk trim, shell script, shell scripting, trim, trim awk, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|