Add strings from one file at the end of specific lines in text file
Hello All,
this is my first post so I don't know if I am doing this right.
I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file.
As an example:
- the file that contains the values to be added (cluster_sizes.txt):
- the file these entries shall be added to at the end of each line that begins with ">" (rep_sequences.fasta):
so the output should look like:
is this possible with awk or some similar language/ command? I have been searching on the net but don't really know how to get towards the needed information. I am a newbie to this world of text manipulation.
Hi, experts,
I would like to create a function that can calculate the total number of lines in a saved text file and delete specific lines in that particular file (I only want the last few lines). Hav anybody have the experience and giv me a hand in this? (9 Replies)
Hi Guys, :D
I am very much new to UNIX. I dont have much basics of coding in UNIX, so please help me out of thi ssituation.
I have a file say for ex: ABC.dtd and it contains "|" delimited data as
test1|testing|test3|moving
past1|runing|test4|going
I need to add a column at the end... (6 Replies)
Hi,
I assume there is a simple solution, but as usual i can't find it!
How can i add a line of text to the end of a text file on a new line?
i.e
file.txt
________________
this is my text file
________________
file.txt
________________
this is my text file
WITH A NEW LINE... (6 Replies)
I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it.
For example, Here is a portion of a zone file.
IN NS ns1.domain.tld.
IN NS ns2.domain.tld.
IN ... (2 Replies)
hello,
I go text file like this
E:/DDD/Dyndede/wwww
E:/DDD/sss.com/ffffg/fff
E:/DDD/vvvvvv/dd
E:/DDD/sss.com/bbbbbb
E:/DDD/sss.com/nnnn/xxI want to print
/alpha.jpg at the end of every lines like that
E:/DDD/Dyndede/wwww/alpha.jpg
E:/DDD/sss.com/ffffg/fff/alpha.jpg... (8 Replies)
Hi all,
I've got 2 files.
File 1 has a list say
a
b
c
d
e
f
File 2 got
start=
What I want is to create File 3 which look like this
start=a,b,c,d,e,f
So is it possible to loop throught File1 to echo it into File3 in one line? (3 Replies)
Hi,
I want to add a text to the end of the specific line in a file. Now my file looks like this:
999
111
222
333
111
444
I want to add the string " 555" to the end of the first line contaning 111. Moreover, I want to insert a newline after this line containg the "000" string. The... (8 Replies)
so...
Lets assume I have a text file.
The text file contains multiple "#" symbols.
I want to replace all thos "#"s with a STRING using DOS/Batch
I want to add a certain TEXT to the end of each line.
How can I do this WITHOUT aid of sed, grep or anything linux related ? (1 Reply)
I have a log file which lists groups and users in the following format
GROUP1
user1
user2
user3
GROUP2
user4
user5
user6
GROUP3
user7
user8
I need to change the format to:
user1|GROUP1
user2|GROUP1
user3|GROUP1
user4|GROUP2 (3 Replies)
Discussion started by: Angela S
3 Replies
LEARN ABOUT OSX
mkmsgs
mkmsgs(1) User Commands mkmsgs(1)NAME
mkmsgs - create message files for use by gettxt
SYNOPSIS
mkmsgs [-o] [-i locale] inputstrings msgfile
DESCRIPTION
The mkmsgs utility is used to create a file of text strings that can be accessed using the text retrieval tools (see gettxt(1), srchtxt(1),
exstr(1), and gettxt(3C)). It will take as input a file of text strings for a particular geographic locale (see setlocale(3C)) and create a
file of text strings in a format that can be retrieved by both gettxt(1) and gettxt(3C). By using the -i option, you can install the cre-
ated file under the /usr/lib/locale/locale/LC_MESSAGES directory (locale corresponds to the language in which the text strings are writ-
ten).
inputstrings is the name of the file that contains the original text strings. msgfile is the name of the output file where mkmsgs writes
the strings in a format that is readable by gettxt(1) and gettxt(3C). The name of msgfile can be up to 14 characters in length, but may not
contain either (null) or the ASCII code for / (slash) or : (colon).
The input file contains a set of text strings for the particular geographic locale. Text strings are separated by a newline character. Non-
graphic characters must be represented as alphabetic escape sequences. Messages are transformed and copied sequentially from inputstrings
to msgfile. To generate an empty message in msgfile, leave an empty line at the correct place in inputstrings.
Strings can be changed simply by editing the file inputstrings. New strings must be added only at the end of the file; then a new msgfile
file must be created and installed in the correct place. If this procedure is not followed, the retrieval function will retrieve the wrong
string and software compatibility will be broken.
OPTIONS
The following options are supported:
-o Overwrite msgfile, if it exists.
-i locale Install msgfile in the /usr/lib/locale/locale/LC_MESSAGES directory. Only someone who is super user or a member of group
bin can create or overwrite files in this directory. Directories under /usr/lib/locale will be created if they do not
exist.
EXAMPLES
Example 1: Using the mkmsgs command.
The following example shows an input message source file C.str:
File %s: cannot be opened
%s: Bad directory
.
.
.
write error
.
.
Example 2: Using Input Strings From C.str to Create Text Strings in a File
The following command uses the input strings from C.str to create text strings in the appropriate format in the file UX in the current
directory:
example% mkmsgs C.str UX
Example 3: Using Input Strings From FR.str to Create Text Strings in a File
The following command uses the input strings from FR.str to create text strings in the appropriate format in the file UX in the directory
/usr/lib/locale/fr/LC_MESSAGES:
example% mkmsgs -i fr FR.str UX
These text strings would be accessed if you had set the environment variable LC_MESSAGES=fr
and then invoked one of the text retrieval tools listed at the beginning of the DESCRIPTION section.
FILES
/usr/lib/locale/locale/LC_MESSAGES/*
message files created by mkmsgs
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Availability |SUNWloc |
+-----------------------------+-----------------------------+
SEE ALSO exstr(1), gettxt(1), srchtxt(1), gettxt(3C), setlocale(3C), attributes(5)SunOS 5.10 26 Jul 1994 mkmsgs(1)