Search words in any quote position and then change the words


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Search words in any quote position and then change the words
# 1  
Old 01-11-2017
Search words in any quote position and then change the words

hi,

i need to replace all words in any quote position and then need to change the words inside the file thousand of raw.

textfile data :
Code:
  "Ninguno","Confirma","JuicioABC"
  "JuicioCOMP","Recurso","JuicioABC"
  "JuicioDELL","Nulidad","Nosino"
  "Solidade","JuicioEUR","Segundo"

need output like :
Code:
  "Ninguno","Confirma","Inciso"
  "Inciso","Recurso","Inciso"
  "Inciso","Nulidad","Nosino"
  "Solidade","Inciso","Segundo"

The criteria to be replace start with word "JuicioXXX"

Thanking you.



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

Last edited by RudiC; 01-11-2017 at 04:57 AM.. Reason: Added CODE tags.
# 2  
Old 01-11-2017
Try
Code:
sed 's/"Juicio[^"]*"/"Inciso"/g' file
  "Ninguno","Confirma","Inciso"
  "Inciso","Recurso","Incisio"
  "Inciso","Nulidad","Nosino"
  "Solidade","Inciso","Segundo"

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace particular words in file based on if finds another words in that line

Hi All, I need one help to replace particular words in file based on if finds another words in that file . i.e. my self is peter@king. i am staying at north sydney. we all are peter@king. How to replace peter to sham if it finds @king in any line of that file. Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies

2. UNIX for Dummies Questions & Answers

Replace the words in the file to the words that user type?

Hello, I would like to change my setting in a file to the setting that user input. For example, by default it is ONBOOT=ON When user key in "YES", it would be ONBOOT=YES -------------- This code only adds in the entire user input, but didn't replace it. How do i go about... (5 Replies)
Discussion started by: malfolozy
5 Replies

3. Shell Programming and Scripting

Gawk gensub, match capital words and lowercase words

Hi I have strings like these : Vengeance mitt Men Vengeance gloves Women Quatro Windstopper Etip gloves Quatro Windstopper Etip gloves Girls Thermobite hooded jacket Thermobite Triclimate snow jacket Boys Thermobite Triclimate snow jacket and I would like to get the lower case words at... (2 Replies)
Discussion started by: louisJ
2 Replies

4. Shell Programming and Scripting

How count the number of two words associated with the two words occurring in the file?

Hi , I need to count the number of errors associated with the two words occurring in the file. It's about counting the occurrences of the word "error" for where is the word "index.js". As such the command should look like. Please kindly help. I was trying: grep "error" log.txt | wc -l (1 Reply)
Discussion started by: jmarx
1 Replies

5. Shell Programming and Scripting

Put words to fix position in a file

Hi all, There are several lines in my file as a=123,b=dene,c=2312,d=234234,g=vxcvxcv,h=44 a=3,b=dene,c=22,d=23422342334,g=vxcvxcv,h=4 a=123,b=dene,c=2312,d=234234,g=vxcvxcv,h=678 I take values with this command awk -F '' '{print $1,$2,$3}' a.txt I want to put values to a fix position... (6 Replies)
Discussion started by: bahadiraktan
6 Replies

6. Shell Programming and Scripting

Search between two words

Hello, I try to print out with sed or awk the 21.18 between "S3 Temperature" and "GrdC" in a text file. The blanks are all real blanks no tabs. Only the two first chars from temperture are required. So the "21" i need as output. S3 Temperatur 21.18 GrdC No Alarm ... (3 Replies)
Discussion started by: felix123
3 Replies

7. Shell Programming and Scripting

Shell script to find out words, replace them and count words

hello, i 'd like your help about a bash script which: 1. finds inside the html file (it is attached with my post) the code number of the Latest Stable Kernel, 2.finds the link which leads to the download location of the Latest Stable Kernel version, (the right link should lead to the file... (3 Replies)
Discussion started by: alex83
3 Replies

8. Shell Programming and Scripting

need help to position words

Hi, I would like to have script that can do below, position words in the lines in a file, from below format firstname, lastname B200000 . . . into this format - <5 spaces>first name, lastname<29 spaces from extreme left>B200000 . . . Any idea how I can do this? :b: (8 Replies)
Discussion started by: upengan78
8 Replies

9. UNIX for Dummies Questions & Answers

To Extract words from File based on Position

Hi Guys, While I was writing one shell script , I just got struck at this point. I need to extract words from a file at some specified position and do some comparison operation and need to replace the extracted word with another word. Eg : I like Orange very much. I need to replace... (19 Replies)
Discussion started by: kuttu123
19 Replies

10. Shell Programming and Scripting

Search 3 words

Hi All, I have almost 1000+ files and I want to search specific pattern. Looking forwarded your input. Pls note that need to ignore words in between /* */ Search for: "insert into xyz" (Which procedure contain all 3). Expected output: procedure test1 procedure test2 procedure test3 File... (12 Replies)
Discussion started by: susau_79
12 Replies
Login or Register to Ask a Question