Load text remove


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Load text remove
# 8  
Old 10-19-2013
Please post your input file contents and desired output .
# 9  
Old 10-19-2013
Try:
Code:
sed 's|</\{0,1\}load>[[:blank:]]*||g' file



--
Note: \?, \| and \t are GNU sed only.

Last edited by Scrutinizer; 10-19-2013 at 10:16 AM..
# 10  
Old 10-19-2013
Here's another sed solution:

Code:
sed 's/\(<load>\|<\/load>\)//g; s/^[ \t]*//' file*.txt

# 11  
Old 10-19-2013
Quote:
Originally Posted by Scrutinizer
Try:
Code:
sed 's|</\{0,1\}load>[[:blank:]]*||g' file



--
Note: \? and \t are GNU sed only.
Not working. Space is still there and also load is also there.

---------- Post updated at 07:22 AM ---------- Previous update was at 07:20 AM ----------

Quote:
Originally Posted by mjf
Here's another sed solution:

Code:
sed 's/\(<load>\|<\/load>\)//g; s/^[ \t]*//' file*.txt

This one is working.
# 12  
Old 10-19-2013
Code:
sed 's;</\?load>[[:space:]]*;;g' file

Emanuele
# 13  
Old 10-19-2013
Quote:
Originally Posted by learnbash
Not working. Space is still there and also load is also there.
[..]
How can this be? You provided this input:
Code:
<load>Full Load</load>
<load>	Full Load</load>

With regular sed:
Code:
$ sed 's|</\{0,1\}load>[[:blank:]]*||g' file
Full Load
Full Load

And with GNU sed
Code:
$ gsed 's|</\{0,1\}load>[[:blank:]]*||g' file
Full Load
Full Load

So which input file are you using? It seems to me that your input sample does not correspond to your actual data...
What is is your OS and version?

with multiple files:
Code:
$ cat file1
<load>Full Load</load>
$ cat file2
<load>	Full Load</load>
$ sed 's|</\{0,1\}load>[[:blank:]]*||g' file[12]
Full Load
Full Load


Last edited by Scrutinizer; 10-19-2013 at 10:31 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remove the text between all curly brackets from text file?

Hello experts, I have a text file with lot of curly brackets (both opening { & closing } ). I need to delete them alongwith the text between opening & closing brackets' pair. For ex: Input:- 59. Rh1 Qe4 {(Qf5-e4 Qd8-g8+ Kg6-f5 Qg8-h7+ Kf5-e5 Qh7-e7+ Ke5-f5 Qe7-d7+ Qe4-e6 Qd7-h7+ Qe6-g6... (6 Replies)
Discussion started by: prvnrk
6 Replies

2. UNIX for Dummies Questions & Answers

VPS has load 200, httpd load no activity, netstat nothing

Hello, on my hostserver i see one VPS of mine got load of 200.00 and netstat nothing (not a single blank line on netstat command) after some time, netstat started showing connections, but i see no excessive IP connections. tail -f /var/log/httpd/access_log shows no activity /var/log/messages ;... (1 Reply)
Discussion started by: postcd
1 Replies

3. Shell Programming and Scripting

How to remove all text except pattern

i have nasty html file with 2000+ simbols in 1 row...i need to remove whole the code except title="Some title..." and store those into file with titles (the whole text is in variable text) i've tried something like this: echo $text | sed 's/.*\(title=\".+\"\).*/\1/' > titles.html BUT it does... (13 Replies)
Discussion started by: Lukasito
13 Replies

4. Shell Programming and Scripting

load a data from text file into a oracle table

Hi all, I have a data like, 0,R001,2,D this wants to be loaded into a oracle database table. Pl let me know how this has to be done. Thanks in advance (2 Replies)
Discussion started by: raji35
2 Replies

5. Shell Programming and Scripting

shell script to read data from text file and to load it into a table in TOAD

Hi....can you guys help me out in this script?? Below is a portion text file and it contains these: GEF001 000093625 MKL002510 000001 000000 000000 000000 000000 000000 000001 GEF001 000093625 MKL003604 000001 000000 000000 000000 000000 000000 000001 GEF001 000093625 MKL005675 000001... (1 Reply)
Discussion started by: pallavishetty
1 Replies

6. Programming

Load text file into a MySQL field

Hello, maybe this post is offtopic, sorry for the inconveniencies. I found examples about how to populate different fields from a text file (with MySQL, the LOAD DATA INFILE sentece), but not about how to load a complete plain text file into a concrete database field. Could you please tell me if... (1 Reply)
Discussion started by: aristegui
1 Replies

7. Shell Programming and Scripting

Perl script to load text file into DB field

Hello, maybe this post is offtopic, sorry for the inconveniencies (maybe should be in the forum with questions about C, C++, Java, SQL...). I found examples about how to populate different fields from a text file (with MySQL, the LOAD DATA INFILE sentece), but not about how to load a complete... (2 Replies)
Discussion started by: aristegui
2 Replies

8. Shell Programming and Scripting

Need help in wrting Load Script for a Load-Resume type of load.

hi all need your help. I am wrting a script that will load data into the table. then on another load will append the data into the existing table. Regards Ankit (1 Reply)
Discussion started by: ankitgupta
1 Replies

9. UNIX for Dummies Questions & Answers

How to load text editor PICO

Hi... I was wondering if anyone has any step by step guide on how to load the UNIX text editor PICO onto the Sun box? Thanks :) (2 Replies)
Discussion started by: atomicsushi
2 Replies
Login or Register to Ask a Question