Sponsored Content
Top Forums Shell Programming and Scripting How to strip out common terms in string Post 302221579 by ahjiefreak on Monday 4th of August 2008 09:16:23 PM
Old 08-04-2008
Hi,

Actually, the data I have previously is just an analogy.

In real case, i have this file of thousands of rows of numbers ending with a text.


Please advise.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to strip a string

I have a file that looks like this: /home/fred/opt/bin /opt/usr/bin /usr/sbin/var/opt I need a way to chop of everything after the last occurance of the / sign including the /. So the file above will now look like this below. /home/fred/opt /opt/usr /usr/sbin/var I tried using... (6 Replies)
Discussion started by: x96riley3
6 Replies

2. Shell Programming and Scripting

Strip a string in sh

I have a list of servers that I need my script to ping however this list also has the env they belong too such as SIT, PRD, warehouse and so on. The break character for each section is : A value in my list would look like this... brutus.grhq.xxx.com:warehouse Where brutus.grhq.gfs.com is... (13 Replies)
Discussion started by: LRoberts
13 Replies

3. Shell Programming and Scripting

Strip out the string

awk -F"\t" -vOFS="\t" '{print $1"\t-\t-","",$6,$7"\t-"$8"\t-\t-\t"$15}' file.tsv > output.tsv Using the above command how to remove the string www.abc.com from the $7 value. (7 Replies)
Discussion started by: sandy1028
7 Replies

4. UNIX for Dummies Questions & Answers

Combine multiple files with common string into one new file.

I need to compile a large amount of data with a common string from individual text files throughout many directories. An example data file is below. I want to search for the following string, "cc_sectors_1" and combine all the data from each file which contains this string, into one new... (2 Replies)
Discussion started by: GradStudent2010
2 Replies

5. Shell Programming and Scripting

Need help joining two files with a common string

Hi all, I have one file that is in the form: S0243K05_T7_S0243K05_|_BASS2243.C7_K05 groupVI. 88.76 S0137F20_SP6_S0137F20_|_BASS2137d.SPB2.2_C10 groupXXI 88.06 S0056F03_T7_S0056F03_|_BASS256c.C7_C02 groupXIX 85.99 S0056F03_T7_S0056F03_|_BASS256c.C7_C02 groupXIX 83.23... (3 Replies)
Discussion started by: repiv
3 Replies

6. Shell Programming and Scripting

Find common terms in two text file, xargs, grep

Hello, I'm interested in finding all occurrences of the terms in file1 in file2, which are both csv files. I can do this with a loop but I'm interested in knowing if I can also do it with the help of xargs and grep. What I have tried: cat file1 | xargs grep file2 The problem is that... (15 Replies)
Discussion started by: eon
15 Replies

7. Shell Programming and Scripting

Strip leading and numbers from a string.

Hello I have two vars loaded with $VAR1="ISOMETHING103" $VAR2="COTHERTHING04" I need to: 1) Strip the first char. Could be sed 's/^.//' 2) The number has it's rules. If it has "hundreds", it needs to be striped. If it is just two digits it shouldn't. So, for VAR1 output should be... (7 Replies)
Discussion started by: tristezo2k
7 Replies

8. Shell Programming and Scripting

Search string within a file and list common words from the line having the search string

Hi, Need your help for this scripting issue I have. I am not really good at this, so seeking your help. I have a file looking similar to this: Hello, i am human and name=ABCD. How are you? Hello, i am human and name=PQRS. I am good. Hello, i am human and name=ABCD. Good bye. Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies

9. UNIX for Beginners Questions & Answers

Replace substring by longest string in common field (awk)

Hi, Let's say I have a pipe-separated input like so: name_10|A|BCCC|cat_1 name_11|B|DE|cat_2 name_10|A|BC|cat_3 name_11|B|DEEEEEE|cat_4 Using awk, for records with common field 2, I am trying to replace all the shortest substrings by the longest string in field 3. In order to get the... (5 Replies)
Discussion started by: beca123456
5 Replies
NUMCONV(1)							   User Commands							NUMCONV(1)

NAME
numconv - convert numbers from one number system to another SYNOPSIS
Numconv <options> DESCRIPTION
numconv is a filter that converts integers from one number system to another. For example, it can convert from Roman Numerals such as "CCLVI" to ordinary Western numbers such as "256" or from Western numbers to Chinese. The great majority of number systems, both modern and ancient, are supported, including numerous variants. If the input number system is 'all', the number system will be autodetected. numconv is a command line interface to libuninum a library for converting between textual representations of numbers and machine-internal representations. Further information about the conversions performed is available in the documentation for this library. OPTIONS
-i <input file> Read input from the specified file. -o <output file> Write output into the specified file. -I Identify the number system of the input. -c List the available number system cover terms. -l List the available number systems. -f <input number system> Specify the number system of the input. -t <output number system> Specify the number system of the output. -b <input base> Specify the input base for Western numbers. The base must be in the range [1,36]. -B <output base> Specify the output base for Western numbers. The base must be in the range [1,36]. -g <output general group size> Specify the size of digit groups other than the ow-order group. The default is 3. -G <output low group size> Specify the size of the low-order group of digits. The default is 3. -s <output group separator character> Specify character to use as "thousands separator". The default is a comma. -L Set the output grouping parameters, general group size, first group size, and group separator character, according to the current locale. -m When generating Roman numerals, use unit characters with superscript macron for thousands greater than one instead of Ms. -h Print help information. -v Print version information. EXAMPLES
To convert from Roman Numerals to ordinary Western numbers: numconv -f Roman -t Western_Lower To convert from ordinary Western numbers to the variety of number in current use in the People's Republic of China: numconv -f Western -t Mandarin_Regular_Simplified To convert from ordinary Western numbers to Western numbers in base 2: numconv -f Western_Lower -t Western_Lower -B 2 To convert from Urdu numbers to Hindi numbers with the traditional Indian grouping: numconv -f Perso_Arabic -t Devanagari -g 2 SEE ALSO
libuninum (3) AUTHOR
Bill Poser (billposer@alum.mit.edu) LICENSE
GNU General Public License, version 2. (http://www.gnu.org/licenses/gpl.txt) numconv September 2007 NUMCONV(1)
All times are GMT -4. The time now is 06:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy