Sponsored Content
Full Discussion: Extracting Words from Text
Top Forums Shell Programming and Scripting Extracting Words from Text Post 302643483 by Scott on Saturday 19th of May 2012 01:48:31 PM
Old 05-19-2012
If you're using a Mac, then:

Code:
sed -i .bak "s/\[[^]]*/[ /g" file

(ps: you did the right thing sticking with Snow Leopard Smilie)
This User Gave Thanks to Scott For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extracting some words

i run a command that submits a word to WordNET which stores the search results in a document which looks like this... i searched "car" in this instance and id like to extract auto, automobile, machine, and store it in a file with the , , stripped away just the words. WordNET's results' template... (2 Replies)
Discussion started by: mark_nsx
2 Replies

2. UNIX for Dummies Questions & Answers

extracting text and reusing the text to rename file

Hi, I have some ps files where I want to ectract/copy a certain number from and use that number to rename the ps file. eg: 'file.ps' contains following text: 14 (09 01 932688 0)t the text can be variable, the only fixed element is the '14 ('. The problem is that the fixed element can appear... (7 Replies)
Discussion started by: JohnDS
7 Replies

3. Shell Programming and Scripting

Extracting Text Between Two Words

Hi all! Im trying to extract a portion of text from a KML and put it into a new file. Im trying to get all of the points out of it, ignoring everything else so I need only the text between <Placement> and </Placement>. Is there a way to make it extract all instances of these points and not just... (2 Replies)
Discussion started by: Grizzly
2 Replies

4. Shell Programming and Scripting

Extracting part of line between two words

Hi, I have a file few hundred MB's with text like one below in single line. 20091117 abc xyg 20091117 def ghi 20091118 ppp ttt 20091118 zzz zzz xxx I need to extract part of line from 1st occurence of pattern 20091117 till first occurence of another pattern 20091118. I tried... (3 Replies)
Discussion started by: artistic94555
3 Replies

5. Shell Programming and Scripting

words extracting

Hi, Pls assist. dn: uid=test,ou=test,dc=com description: password sunIdentityServerDeviceStatus: Active uid: test objectClass: sunIdentityServerDevice objectClass: iplanet-am-user-service objectClass: top objectClass: iPlanetPreferences sunIdentityServerDeviceType: blabla cn: default... (3 Replies)
Discussion started by: hudson03051nh
3 Replies

6. UNIX for Dummies Questions & Answers

Extracting only words from a log file

hello: i have a file and i am trying to extract only unique words from that file. i used the command: cat messages.1 | tr " " "\n" | sort | uniq -c but using this command outputs everything unique in the file be it words, numbers, like all the characters..i need a command which will only... (6 Replies)
Discussion started by: vikbenq
6 Replies

7. Shell Programming and Scripting

Help with extracting words from fixed length files

I am very new to scripting and need to write a script that will extract the account number from a line that begins with HDR. For example, the file is as follows HDR2010072600300405505100726 00300405505 LBJ FREEWAY DALLAS TELEGRAPH ... (9 Replies)
Discussion started by: bds052189
9 Replies

8. Shell Programming and Scripting

Extracting words from file

I am having a file from which i need to extract different length words into different file. For example 2 letter word into file2, 3 letter word into file3 and so on.... I did one using grep and shell script.. for (( i=1; i<7; i++)) do egrep -o '\<\(?{$i}\)?\>' $1 | sort -u -f|tr >file$i... (4 Replies)
Discussion started by: akhay_ms
4 Replies

9. Shell Programming and Scripting

grep - Extracting multiple key words from stdout

Hello. From command line, the command zypper info nxclient return a bloc of data : linux local # zypper info nxclient Loading repository data... Reading installed packages... Information for package nxclient: Repository: zypper_local Name: nxclient Version: 3.5.0-7 Arch: x86_64... (7 Replies)
Discussion started by: jcdole
7 Replies

10. Shell Programming and Scripting

Extracting words and lines based on keywords

Hello! I'm trying to process a text file and am stuck at 2 extractions. Hoping someone can help me here: 1. Given a line in a text file and given a keyword, how can I extract the word preceeding the keyword using a shell command/script? For example: Given a keyword "world" in the line: ... (2 Replies)
Discussion started by: seemad
2 Replies
mkmsgs(1)						      General Commands Manual							 mkmsgs(1)

NAME
mkmsgs - create message files for use by gettxt() SYNOPSIS
locale] textfile msgfile DESCRIPTION
The command takes as input a file of localized text strings and generates a message file that can be accessed by the gettxt(3C) routine. textfile is the name of the file that contains the text strings. msgfile is the name of the output message file. appends the suffix to the message file name. The combined length of the file name should be less than 14 bytes for short file name file system. The msgfile file should not contain a colon since it will confuse the formatting routines. The textfile file contains the localized text strings. The text strings are separated by a newline character. The text strings are pro- cessed sequentially and copied to the msgfile message file. An empty line in the input results in a corresponding empty message written to the msgfile message file. Options The command supports the following options: Overwrite the msgfile message file if it exists. The msgfile message file is installed in the system-wide localization directory corresponding to the specified locale. Only a user with the appropriate privileges can create or overwrite the message file in that directory. The direc- tory will be created if it does not exist. EXTERNAL INFLUENCES
Environment Variables determines the interpretation of messages as single- and/or multibyte characters. Messages are issued in if it is set to a valid language and messages are available. Otherwise "C" locale messages are issued. If is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty vari- able. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support Single- and multibyte character code sets are supported. EXAMPLES
The following example shows the format of the input text strings: WARNINGS
is provided for SVID3 compatibility only. The user is encouraged to use the NLS mechanism developed by HP and the X/Open Company, Ltd. SEE ALSO
gencat(1), gettxt(3C), setlocale(3C). STANDARDS COMPLIANCE
mkmsgs(1)
All times are GMT -4. The time now is 06:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy