Sponsored Content
Full Discussion: Parse Directory path - awk
Top Forums Shell Programming and Scripting Parse Directory path - awk Post 303039552 by greycells on Wednesday 9th of October 2019 08:12:57 AM
Old 10-09-2019
Hi ..

Code:
level1,/level2/level3/level4/ora003,4,IBB25
level1,/level2/level3/level4/ora003/ddu1,,

In this case ... $4 is not same ... so both lines get copied to file2

Last edited by vgersh99; 10-09-2019 at 10:37 AM.. Reason: code tags, please!
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parse value from multiple row to create the path

Hi all, Hope all the expert can help me in this situation. Let say I have one file with multiple record like below: NAME=FRAGMENT LANGUAGE=1 DIALECT=0 GENDER=NONE FILE=TEST1 DIRECTORY=D:/DETAILS/1/0/test1.txt END NAME=FRAGMENT LANGUAGE=1 DIALECT=0 GENDER=NONE (13 Replies)
Discussion started by: shirleyeow
13 Replies

2. UNIX for Dummies Questions & Answers

awk to parse a directory name?

Hi, I have a directory file name: /auto/space/user/jen/CED/CED_01MZ/visit1/DCE_2eco/016/echo1 I would like to just get the following outputs into variables such that: variable1 = /auto/space/user/jen/CED/CED_01MZ/visit1/ and variable2 = DCE_2eco/016/echo1 I've tried it with... (2 Replies)
Discussion started by: nixjennings
2 Replies

3. Shell Programming and Scripting

Retrieve directory path from full file path through sh

Hi, I have a file abcd.txt which has contents in the form of full path file names i.e. $home> vi abcd.txt /a/b/c/r1.txt /q/w/e/r2.txt /z/x/c/r3.txt Now I want to retrieve only the directory path name for each row i.e /a/b/c/ /q/w/e/ How to get the same through shell script?... (7 Replies)
Discussion started by: royzlife
7 Replies

4. Shell Programming and Scripting

sed/awk for extracting directory from file path

Hi, I have following path: set file_path = D:/forums/prac/somedir/new1/file1.txt or set file_path = E:/new/forums1/prac/somedir/new2/file2.txt I need to grep "somedir" from file path. In this case preceding directory "prac" remains same for both the paths, but directories preceding... (7 Replies)
Discussion started by: sarbjit
7 Replies

5. Shell Programming and Scripting

Parse file name out of UNC path

Hello, I searched the forums and didn't see a situation like this: I cannot figure out how to parse out just the file name from the full path. The path looks like this: \\foo\bar\filename.ext I don't think something like 'cut' will work so I tried to whip up a regex but couldn't get it... (12 Replies)
Discussion started by: bytesnoop
12 Replies

6. Shell Programming and Scripting

Parse output path to set variable

I am looking to parse a text file output and set variables based on what is cropped from the parsing. Below is my script I am looking to add this feature too. All it does is scan a certain area of users directories for anyone using up more than X amount of disk space. It then writes to the... (4 Replies)
Discussion started by: es760
4 Replies

7. Shell Programming and Scripting

Variable of Path directory is not parsing in awk

Hi All, i had to split one files into 10 equally. For that i have coded below awk. OUTPUT_FILE=/home/sit/path/Files/file_EXPORT.lst DIR_NM=`dirname ${OUTPUT_FILE}` awk -v CURR_DATE="$(date +'%d-%m-%Y-%H-%M')" -v pth=$DIR_NM '{print >> pth/"tgt_file_name"CURR_DATE"_"NR%10 }' ${OUTPUT_FILE} ... (7 Replies)
Discussion started by: looney
7 Replies

8. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies

9. UNIX for Beginners Questions & Answers

What is the difference ../directory path and ./directory path in ksh?

What is the difference ../directory path and ./directory path in ksh? (1 Reply)
Discussion started by: TestKing
1 Replies
COLLATOR_SET_STRENGTH(3)						 1						  COLLATOR_SET_STRENGTH(3)

Collator::setStrength - Set collation strength

	Object oriented style

SYNOPSIS
public bool Collator::setStrength (int $strength) DESCRIPTION
Procedural style bool collator_set_strength (Collator $coll, int $strength) The ICU Collation Service supports many levels of comparison (named "Levels", but also known as "Strengths"). Having these categories enables ICU to sort strings precisely according to local conventions. However, by allowing the levels to be selectively employed, searching for a string in text can be performed with various matching conditions. o Primary Level: Typically, this is used to denote differences between base characters (for example, "a" < "b"). It is the strong- est difference. For example, dictionaries are divided into different sections by base character. This is also called the level1 strength. o Secondary Level: Accents in the characters are considered secondary differences (for example, "as" < "as" < "at"). Other differ- ences between letters can also be considered secondary differences, depending on the language. A secondary difference is ignored when there is a primary difference anywhere in the strings. This is also called the level2 strength. Note Note: In some languages (such as Danish), certain accented letters are considered to be separate base characters. In most languages, however, an accented letter only has a secondary difference from the unaccented version of that letter. o Tertiary Level: Upper and lower case differences in characters are distinguished at the tertiary level (for example, "ao" < "Ao" < "ao"). In addition, a variant of a letter differs from the base form on the tertiary level (such as "A" and " "). Another exam- ple is the difference between large and small Kana. A tertiary difference is ignored when there is a primary or secondary differ- ence anywhere in the strings. This is also called the level3 strength. o Quaternary Level: When punctuation is ignored (see Ignoring Punctuations ) at level 13, an additional level can be used to dis- tinguish words with and without punctuation (for example, "ab" < "a-b" < "aB"). This difference is ignored when there is a pri- mary, secondary or tertiary difference. This is also known as the level4 strength. The quaternary level should only be used if ignoring punctuation is required or when processing Japanese text (see Hiragana processing). o Identical Level: When all other levels are equal, the identical level is used as a tiebreaker. The Unicode code point values of the NFD form of each string are compared at this level, just in case there is no difference at levels 14. For example, Hebrew can- tillation marks are only distinguished at this level. This level should be used sparingly, as only code point values differences between two strings is an extremely rare occurrence. Using this level substantially decreases the performance for both incremental comparison and sort key generation (as well as increasing the sort key length). It is also known as level 5 strength. For example, people may choose to ignore accents or ignore accents and case when searching for text. Almost all characters are distin- guished by the first three levels, and in most locales the default value is thus Tertiary. However, if Alternate is set to be Shifted, then the Quaternary strength can be used to break ties among whitespace, punctuation, and symbols that would otherwise be ignored. If very fine distinctions among characters are required, then the Identical strength can be used (for example, Identical Strength distinguishes between the Mathematical Bold Small A and the Mathematical Italic Small A.). However, using levels higher than Tertiary the Identical strength result in significantly longer sort keys, and slower string comparison performance for equal strings. PARAMETERS
o $coll -Collator object. o $strength -Strength to set. Possible values are: o Collator::PRIMARY o Collator::SECONDARY o Collator::TERTIARY o Collator::QUATERNARY o Collator::IDENTICAL o Collator::DEFAULT_STRENGTH RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 collator_set_strength(3) example <?php $arr = array( 'ao', 'Ao', 'ao' ); $coll = collator_create( 'en_US' ); // Sort array using default strength. collator_sort( $coll, $arr ); var_export( $arr ); // Sort array using primary strength. collator_set_strength( $coll, Collator::PRIMARY ); collator_sort( $coll, $arr ); var_export( $arr ); ?> The above example will output: array ( 0 => 'ao', 1 => 'Ao', 2 => 'ao', ) array ( 0 => 'ao', 1 => 'Ao', 2 => 'ao', ) SEE ALSO
Collator constants, collator_get_strength(3). PHP Documentation Group COLLATOR_SET_STRENGTH(3)
All times are GMT -4. The time now is 03:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy