Sed Related Problems & Solutions

69 tags
Refine Tags
Search Tags:

Start a discussion

Results 1 - 30 of 69
[Solved] Need to append date from a text file to each record of other
Summary: Hi I have an input file test_file_detail as below (/dir/Temp/test_file_detail1) 1^RAJ^M 2^LEE^M 3^RAMYA^F I need to append the date from a seperate fi...

[Solved] i want to add single quote to a character in my file
Summary: i want to add single quote to a character in my file in unix. i want SENT =Y to be SENT='Y' i am using below command sed -e 's?SENT =Y?SENT='Y'?' Upd...

manipulating entries in csv file
Summary: manipulating entries in csv file using awk or sed or something is it even possible to do something like: file: col1,col2 val1,url1 val2,url2 val2,url3...

SED giving problem when trying to substitute the 10th field
Summary: sed 's/\(....\)\(..\)\(..\)\(..\)\(..\)\(..\)\(...\)\(.\)\(..\)/\1-\2-\3-\4.\5.\6.\7|\8|\9|/' san.txt this command works fine for this data 2003091011...

Retrieve different set of numbers from String
Summary: Hi, Could somebody please help me with getting numbers from a string. I found below sed command to get the numbers alone. echo "asdf 12 asdf 34" | se...

[Solved] Awk selecting multipl lines ranging between specific pattern
Summary: I've got an html file like this garbage html code garbage html code IDENTIFIER juicy line 1 juicy line 2 juicy line 3 IDENTIFIER garbage html code gar...

date fieild in a file needs to change -linux
Summary: Hello, I have cvs file as like bellow, 10,121,Jun282011 23,45,Jun192011 1002,121,Jun062011 My requirement is to change the date field 1 "mmmyyyy" if ...

Alternatives to writing to file
Summary: I'm a self taught at writing unix scripts. These have worked for me in the past but now I'm scaling them up I think some of my ways of approaching th...

XML- Sed Bash script... Help!
Summary: Hi ! I'm working into my first bash script to make some xml modification and it's going to make me crazy lol .. so I decide to try into this forum to ...

script to get the values from a file
Summary: I have a line in a file as follows: <Woekinstnce name="abc" id="ab1"> some times the id field is not constant, it can be in the name place also. I ...

Problem in string replace in unix
Summary: I have a file <<a.rpt>> with values below values. aaa bbb ccc <HTML> <H1>sakthi</H1> </HTML> I am expecting out like below..(include...

i want to create a sed script
Summary: i want to create a sed script to make changes on a text file. for example i have : /* 1) This is a comment with two lines */ and i want to change...

sed trim last 2 octets of ip address
Summary: I am trying to take a standard ip address, 192.168.1.2 and trim it to 192.168. I have tried using sed, but can only get the last octet trimmed. any h...

How to remove a leading 0 from day of month?
Summary: I need to compare dates and I am using the following code: export TODAYSDATE=$(date +"%b %d") | sed 's/0//' or if [ $TEMPDATE = $(date +"%...

sed works with echo but not working with cat
Summary: #echo "A B C D " | sed 's/[ ][ ]*/,/g' output: A,B,C,D, But #cat err.txt | sed 's/[ ][ ]*/,/g' output: COUNTRY INT.D Area Population ...

reading lines 30 to 40 fom a file in unix.
Summary: file has more than 40 lines ...

[Solved] Unix Sed Command
Summary: Hi, I have a "|" file with 5 dates in the format of mm/dd/yy, I only need to change the date format in 2 fields only (field1 and 3) to mmddccyy, here'...

[Solved] Removing Ctrl M characters using sed
Summary: Hi Everyone, I am using sed to remove ^M characters that appear in the file. The ^M are not at the end of the line but within the middle of some of t...

[Solved] sed: add to end of line w/variable in pattern
Summary: Hi All, I'm trying to match a word (a color) in a description field of a csv and if I find this color, add it to the end of a line (creating a new col...

How sed to print match's previous line?
Summary: I have a data like this: 5 3 8 @abc@ 10 2 @cde@ @ijk@ 4 19 --------------------------- I want to make this: 8 @abc@ 2 @cde@ 2 @ijk@ ------------------...

unix sed with */;
Summary: I was sent a script from a unix environment and am trying to figure out what this command is actually doing. I am working in a windows environment and...

how to escape special characters like in sed
Summary: my original file contains echo 123245 > i want the output file like #echo 12345 > i am using syntax sed -i 's/echo 12345 \>/#echo 12345 \>'1.txt but ...

manage comments (sed)
Summary: Hi all, I want to check a file with name 1.c if the comments are in the suitable format. The format is /** comment */ If it is no, I have to conver...

SED command to add text before a line
Summary: Hi, I'm looking for a sed command, which wil place a text before every line that doesn't start with a colon (:) exept for the first 3 lines. Can anybo...

Need sed solution to detect blank lines
Summary: A colleague was faced with a problem of 804 ASCII files and he needed to extract the tabular data out of the first part and the last part into Excel s...

Reading files simultaneously
Summary: I have two files - one with usernames and another with some properties of that user. Users file looks like user1 user2 user3 ... .... second file Pass...

script needed to add word to each line
Summary: I need a script that will add the same word to the beginning of each line in a file Any ideas? ...

how to use sed in a loop w/parameter
Summary: I have a file called MON_ASN with a timestamp at the end. I wasnt strip out the timestamp and put that in each file at the end of each transaction. ...

Is there a line editor for win csv files
Summary: I'm looking for a basic line editor such as ED on ICL mainframes 30 years ago. Something that can easily run repetative edits on a csv file for exampl...

Getting SED is garbled
Summary: getting sed is garbled for sed -n 'H;${g;s/\n/ /g;p}' . I want to remove carriage returns. Operating system Soalris 10 ...

123


Ask Question