Sponsored Content
Top Forums Shell Programming and Scripting Replace string with lines stored in a file Post 303002329 by kraljic on Tuesday 22nd of August 2017 10:28:51 AM
Old 08-22-2017
Thank You Rudic.

what does the sed clause /; s/$/ do ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

replace (sed?) a single line/string in file with multiple lines (string) from another file??

Can someone tell me how I can do this? e.g: Say file1.txt contains: today is monday the 22 of NOVEMBER 2010 and file2.txt contains: the 11th month of How do i replace the word NOVEMBER with (5 Replies)
Discussion started by: tuathan
5 Replies

2. Shell Programming and Scripting

replace a string with contents of a txt file containing multiple lines of strings

Hello everyone, ive been trying to replace a string "kw01" in an xml file with the contents of a txt file having multiple lines. im a unix newbie and all the sed combinations i tried resulted to being garbled. Below is the contents of the txt file: RAISEDATTIME --------------------... (13 Replies)
Discussion started by: 4dirk1
13 Replies

3. Shell Programming and Scripting

replace (sed?) a string in file with multiple lines (string) from variable

Can someone tell me how I can do this? e.g: a=$(echo -e wert trewt ertert ertert ertert erttert erterte rterter tertertert ert) How do i replace the STRING with $a? I try this: sed -i 's/STRING/'"$a"'/g' filename.ext but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies

4. Shell Programming and Scripting

Searching a string stored in other file

I need to design a script which can do the following: I have two files abc.txt and constant.hmtl abc.txt contains some 5 string that I need to see if they exist in contants.html. Constants.hmtl is a very large file around 800 lines. I want to search all the strings present in file... (8 Replies)
Discussion started by: hemasid
8 Replies

5. Shell Programming and Scripting

Search a string and replace the same string above two lines?.

I need to search this "<CardinalMPI>" string and replace the same string above two lines of the string. Nov 16, 2012 12:58:34 PM INFO: Centinel LookUp ResponseXML : <CardinalMPI> <ReasonCode></ReasonCode> <ErrorDesc></ErrorDesc> <MerchantReferenceNumber></MerchantReferenceNumber>... (4 Replies)
Discussion started by: laknar
4 Replies

6. Shell Programming and Scripting

Want to Insert few lines which are stored in some file before a pattern in another file

Hello, I have few lines to be inserted in file_lines_to_insert. In another file final_file, I have to add lines from above file file_lines_to_insert before a particular pattern. e.g. $ cat file_lines_to_insert => contents are abc def lkj In another file final_file, before a... (6 Replies)
Discussion started by: nehashine
6 Replies

7. Shell Programming and Scripting

Grep and sed (replace string in patterned lines)

Grep and Sed (replace string in patterned lines) Hi all, I want to grep for "PATTERN" and only if "PATTERN" is in a line, this line shall be used as replacement input e.g. for SED. I don't get it running in one line. NOT RUNNING - just first idea... I don't know how to redirect grep... (2 Replies)
Discussion started by: unknown7
2 Replies

8. Shell Programming and Scripting

Removing md5sum lines stored in text file

Hello. I'm writing a script where every file you create will generate a md5sum and store it into a text file. Say I create 2 files, it'll look like this in the text file: d41d8cd98f00b204e9800998ecf8427e /helloworld/saystheman d41d8cd98f00b204e9800998ecf8427e /helloworld/test I... (3 Replies)
Discussion started by: batarangs_
3 Replies

9. Shell Programming and Scripting

Replace a string with multiple lines

Hello Guys, I need to replace a string with multiple lines. For eg:- ABC,DEF,GHI,JKL,MNO,PQR,STU need to convert the above as below:- ABC,DEF, GHI1 GHI2 GHI3, JKL,MNO, PQR1 PQR2 PQR3, STU i have tried using code as:- (2 Replies)
Discussion started by: jassi10781
2 Replies

10. Shell Programming and Scripting

Replace a string on specific lines which match a pattren

Hi Experts, I have a file which contains a pattern multiple times i.e. matchthispattren. If a line is matched with this pattern. I want a number in 1234567890 to 123456789 in that line. (Basically remove the last digit from that number. Please help. Thanks, Varun (1 Reply)
Discussion started by: varun22486
1 Replies
DICLIBINTRO(3)						     Library Functions Manual						    DICLIBINTRO(3)

NAME
DICLib intro - dictionary access library introduction DESCRIPTION
The dictionary access library provides basic functions for kana-kanji conversion. The following files are prerequisite to using the dic- tionary access library: Header file canna/RK.h An include file that contains data and function declarations for use by the kana-kanji conversion library. Include this file at compile time. Libraries libcanna.a, libcanna.so Kana-kanji conversion libraries. Specify "-lcanna" at link time. SUMMARY
The dictionary access library provides three major categories of functions: i| Code conversion functions Convert character string codes between double-width and single-width characters and between hiragana and katakana. External data and initialization procedures are not required. i| Romaji-kana conversion functions Convert Romaji to kana by using a Romaji-kana conversion table that defines the correspondence between Romaji and kana. The rules of Romaji-kana conversion can be altered by making modifications to this table. i| Kana-kanji conversion functions Convert kana to kanji through continuous clause conversion by using a kana-kanji conversion dictionary that defines the correspondence between readings and words. Kana-kanji conversion can be performed to meet specific applications by making modifications to this dic- tionary. Among all the functions of Japanese input processing, this library performs only data conversion. To be able to enter Japanese text from a keyboard, therefore, it is necessary for users to write a keyboard handling routine within the application program. i| Code conversion functions Rk(w)CvtZen Convert ASCII characters and single-width katakana to double-width characters. RkCvtHan Convert double-width symbols, alphanumeric characters, hiragana, and katakana to single-width characters. RkCvtKana Convert double-width hiragana to double-width katakana. RkCvtHira Convert double-width katakana to double-width hiragana. RkCvtEuc Convert shift JIS code to EUC code. i| Romaji-kana conversion functions RkOpenRoma Open the dictionary to use for Romaji-kana conversion. RkCloseRoma Close the dictionary used for Romaji-kana conversion. RkMapRoma Perform Romaji-kana conversion by using a specified Romaji-kana conversion dictionary. RkCvtRoma Convert an entire character string from Romaji to kana by iteratively using RkMapRoma. i| Kana-kanji conversion functions RkInitialize Initialize the kana-kanji conversion functions. RkFinalize Terminate the kana-kanji conversion functions. RkCreateContext Create a new conversion context. RkDuplicateContext Create a context having the same conversion environment as a specified context. RkCloseContext Close a specified conversion context. RkGetDicList Get the names of dictionaries that can be added to the dictionary list. RkMountDic Mount a dictionary in the dictionary list. RkGetMountList Get the names of the currently mounted dictionaries. (or characters for RkwResize) RkUnmountDic Unmount a specified dictionary from the dictionary list. RkRemountDic Alter the priority order of a dictionary already in the dictionary list. RkBgnBun Convert the reading of a specified length to kanji. RkEndBun Terminate kana-kanji conversion. RkGoTo Set the clause with a specified clause number as the current clause. RkLeft Move the current clause to the clause to its left. RkRight Move the current clause to its right. RkXfer Set the candidate with a specified candidate number as the current candidate. RkNext Set the next candidate as the current candidate. RkPrev Set the previous candidate as the current candidate. RkNfer Set a reading itself as the current candidate. RkResize Change the reading length of the current clause to len bytes. RkEnlarge Enlarge the reading of the current clause. RkShorten Shorten the reading of the current clause. RkStoreYomi Change the reading of the current clause to a specified reading, reconverting the subsequent clauses. RkGetYomi Get the reading of the current clause. RkGetKanji Get the current candidate for the current clause. RkGetKanjiList Get all kanji candidates for the current clause. RkGetStat Get analysis information about the current candidate. RkGetLex Get morphemic information on each word that makes up the current candidate. RkDefineDic Define a specified candidate in a dictionary. RkDeleteDic Delete a specified candidate from a dictionary. DICLIBINTRO(3)
All times are GMT -4. The time now is 08:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy