Delete ^ using sed


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Delete ^ using sed
# 1  
Old 04-21-2008
Delete ^ using sed

Hi All,


I am very new to UNIX...

I was trying to delete ^ from a file and save it with different name...

The version is AIX 5.3

The input file is in this directory /a/b

The Input file name is o9876.out

I want the output file in same path with different name like ABC.txt

This was the command I was using to run in UNIX Box

sed "s/\^//g" /a/b/o9876.out > a/b/ABC.txt

In the output file it is giving all blank..

can anybody tell me what could be the problem.....

Thx a lot for the Help........


Regards,
US
# 2  
Old 04-21-2008
Quote:
Originally Posted by us_pokiri
Hi All,


This was the command I was using to run in UNIX Box

sed "s/\^//g" /a/b/o9876.out > a/b/ABC.txt

In the output file it is giving all blank..

can anybody tell me what could be the problem.....
The command that you're using, works as expected. You forgot to give the correct full path to the output file ( missing slash / ):

Code:
sed "s/\^//g" /a/b/o9876.out > /a/b/ABC.txt

# 3  
Old 04-21-2008
Hi,

I missed slash here.....but while running the code in my system, i did not miss it.....


Can there be any other Problem for that.......

Thx for the reply.....


Thanks
US
# 4  
Old 04-21-2008
Quote:
Originally Posted by us_pokiri
Hi,

I missed slash here.....but while running the code in my system, i did not miss it.....


Can there be any other Problem for that.......
As far as the above command is concerned, there are no issues with it. If it's part of a script, then check all of your code, check for any typo, or missing character, etc ...
# 5  
Old 04-21-2008
No, that's the only code....







Thanks
US
# 6  
Old 04-22-2008
Hammer & Screwdriver

I tried the code with my system and it is working properly..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed to delete ^M

I am trying to use sed to delete the ^M at the end of the line and when i pass a file './asciiFix.sh wintest.txt' I get an error saying sed: can't read : no such file or dir. Can someone give me a pointer as to what I am doing wrong? #!/bin/sh if file "$@" | grep "with CRLF"; then echo... (5 Replies)
Discussion started by: kwatt019
5 Replies

2. Shell Programming and Scripting

sed delete

I am not able to analyze the below code.. What I expected is that DELETED will be replaced with the first field in every line.But after giving a try, the output was different. Can anyone pleas analyze and explain the code in detail? Many thanks... $ sed 's/* /DELETED /g' g1.txt > g4.txt... (2 Replies)
Discussion started by: giridhar276
2 Replies

3. Shell Programming and Scripting

sed delete range

Hi I would like to delete ranges of text from an html file; In the sentence; aqua>Stroomprobleem in Hengelo verholpen <a href="107-01.html"><font color=yellow>107</a> With several sentences like this in that file, where the text between <a href a> varies, so it needs to be deleted in the... (2 Replies)
Discussion started by: mdop
2 Replies

4. Shell Programming and Scripting

sed delete option

I have tried doing this to delete some lines: sed '1,10d' file Now I want to specify a variable as a line number for example: lastline=wc -l file linestart=$lastline - 20 sed '$linestart,$lastlined' file but this will give error: sed: -e expression #1, char 3: extra characters after... (4 Replies)
Discussion started by: zorrox
4 Replies

5. Shell Programming and Scripting

sed - delete everything until the first digit comes up

Hi, I have a text file with content as follows: bla foo3200492 comment on this: 3900302 here comes the teddy 12 all I need is: 3200492 3900302 12 So I need the correct "sed" command to delete everything until the first number. I am not a regex expert, because I have to... (3 Replies)
Discussion started by: mcW
3 Replies

6. Shell Programming and Scripting

sed-delete

Guys, file1: test \ 123 cat file1 | sed '/test \/d' ---- does not work I have to remove the line "test \" in file1 can somebody help ? (7 Replies)
Discussion started by: giri_luck
7 Replies

7. Shell Programming and Scripting

delete using sed

hi , i need to delete all the lines in a file except a line which starts with the letter SP (6 Replies)
Discussion started by: mhdmehraj
6 Replies

8. UNIX for Dummies Questions & Answers

Sed: Append and Delete?

I think it should be obvious what I'm trying to do from my command, but just to be sure it's clear, I'm trying to append 2 lines after a matched line and then delete 2 other lines within a file. I'd like to do it in 1 line if possible. This code isn't working, but hopefully it's just a syntax... (0 Replies)
Discussion started by: earnstaf
0 Replies

9. Shell Programming and Scripting

sed help - delete last 2 lines.

I have been reading through the sed one liners, trying to understand what is happening. # delete the last 2 lines of a file sed 'N;$!P;$!D;$d' The above will delete the last 2 line of a file. I tried analyzing what happens. And I got lost :( This is what I understood so far from the... (2 Replies)
Discussion started by: vino
2 Replies

10. UNIX for Dummies Questions & Answers

Using sed to delete a string?

Hi all! Here is my problem : I have a string like the following : 20030613170404;BAN_CAV ; starting script Loader.sh on ; 13/06/2003 at ; 17;04;03 I want to eraze all characters located after "Loader.sh", because there are unuseful. I tried to use sed...but it didnt work....i guess i... (1 Reply)
Discussion started by: HowardIsHigh
1 Replies
Login or Register to Ask a Question