Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Replacing Consecutive pipes
Name: mailme_anil Date: December 22, 2004 at 07:33:20 Pacific OS: UNIX CPU/Ram: 1gb
Comment:
Hi,
I am having a file which has 9 million records. Few records in between are having no value for a field resulting in two consecutive pipes(||). Because of this, the data load is getting rejected. I want to replace these consecutive pipes(||) with a space between them(| |). Please provide a solution for this.
Ex : abc|123|aa||bcd|23^M
I want the above record as : abc|123|aa| |bcd|23^M
Summary: I am assuming that you wish to replace them within a file. If so, use: sed -e 's/_DEMAND_/_COMMIT_/g' in.data1 > out.data1 In my example, I called your input file in.data1 and output it to a file cal...
Summary: I have a text file containing 100's of thousands of rows. For each line in the file, I want to remove the pipe | character if it exists between position 22 and position 57 on each line. All other pi...
Summary: If I'm understanding you correctly, your field seperator is |.| that is, a pipe symbol, a period, a pipe symbol. A stray pipe symbol messes up your data. One way of doing this is to choose a character...