Word change in a document


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Word change in a document
# 1  
Old 04-17-2018
Word change in a document

I have a bunch of documents where I need to change the word pi to pisignage.
No big deal there:

Code:
sed -i -e 's/pi/spisignage/g' /path/to/file

However it is finding things like the word stopping and making the word stoppisignageng.

Any suggestions to just find the word pi and change it?

Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 04-17-2018 at 04:57 PM.. Reason: Added CODE tags.
# 2  
Old 04-17-2018
Welcome to the forum.

Please don't post duplicates, and use code tags.
# 3  
Old 04-17-2018
figured it out. Mind fart on my side.

Code:
sed -i -e 's/\bpi\b/pisignage/g'

Moderator's Comments:
Mod Comment Seriously: Please use CODE tags as required by forum rules!

Last edited by RudiC; 04-17-2018 at 05:07 PM.. Reason: Added CODE tags.
This User Gave Thanks to wspgpete For This Post:
# 4  
Old 04-17-2018
Some sed provide "word boundary" designators, like \b or \> and \< in GNU sed.

Depending on your OS (which you fail to mention, btw), your sed version may or may not offer equivalent syntax.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Word change in a document

I have a bunch of documents where I need to change the word pi to pisignage. No big deal there: sed -i -e 's/pi/spisignage/g' /path/to/file However it is finding things like the word stopping and making the word stoppisignageng. Any suggestions to just find the work pi and change it? ... (0 Replies)
Discussion started by: wspgpete
0 Replies

2. Shell Programming and Scripting

Creating word document (.doc) with attachment in unix solaris

Hi All, Is it possible to creation a word document (.doc) in unix solaris which includes an attachment (i.e similar to insert -> object add attachment in windows) Requirement is to add files into .doc and the files is present in unix servers. Is it possible to do this within unix instead... (5 Replies)
Discussion started by: ajay547
5 Replies

3. Programming

extract xml data and create word document using perl.

hi, i have large xml file which contains students information, i need to extract student number and some address tags and create a word document for the extracted data. my data looking llike this <student> <number>24</number> <education>bachelors</education> ... (1 Reply)
Discussion started by: veerubiji
1 Replies

4. Shell Programming and Scripting

copy contents of unix file to Word document

Hello, I have a unix file about 3000lines which i want to copy from and paste it into a Word document. If i cat the file and try to scroll through it then not everything is captured so i am getting and incomplete paste. Any help is really appreciated. jak (2 Replies)
Discussion started by: jakSun8
2 Replies

5. Solaris

Copy and paste text from a word document into a txt file in vi

Hello, Can anybody please tell me how we can copy and paste text from a word document into a text file that we are editing in vi? Is it possible to do that while we are editing the text file in vi in insert mode? Thanks, (3 Replies)
Discussion started by: Pouchie1
3 Replies

6. UNIX for Dummies Questions & Answers

Converting LATEX PDF to WORD document

Hi there, is it possible to convert pdf files to Word with some free :p software or with some trick??? Now I'm working with LATEX and I can get pdf format but I would like to get .rtf or .doc files too:rolleyes:. Lately I found something like that, but it wasn't free. Thanks for any... (1 Reply)
Discussion started by: Giordano Bruno
1 Replies

7. Shell Programming and Scripting

Grep MS Word document

Hi, I have to read a MS word document to find some strings(expressions) .The reading should be done by paragraph.I have to show the entire paragraph If I find any string/expression in that. Please help me out. Thanks Regards Kris (5 Replies)
Discussion started by: mkris
5 Replies

8. UNIX for Advanced & Expert Users

Mutt - Word Document or Formatted text as a Message

Hi, I am writing a mailing script by using mutt command. I that i have facing a issues. because, i want to send Some Formatted text as the mail message. but, i try to send the Word Document file as the Mail message. it shows some junk characters in the mail. :confused:I think the mutt command is... (1 Reply)
Discussion started by: krsenkumar
1 Replies

9. UNIX for Dummies Questions & Answers

transfer word document using ftp,sftp

Hello All, I want to transfer some world documents from solaris server to my local PC. using FTP i can not see the content of the files. Pls. tell me some other alternative (as sftp - i have tried with sftp ip_address which is not working) . (3 Replies)
Discussion started by: artikulkarni
3 Replies

10. UNIX for Dummies Questions & Answers

How to conver a unix output file to Microsoft word document

Hi, I'am are working on Unix platform. It requires for me to present the certain unix files in Microsoft word. Is conversion of a Unix ".out" file to Microsoft word feasible????? Kindly Let me know on this... Thanks in Advance, Divya (1 Reply)
Discussion started by: divyacl
1 Replies
Login or Register to Ask a Question