Sponsored Content
Top Forums Shell Programming and Scripting Creating a master file of conjugated verbs by concatenating root and inflection from separate files Post 303011334 by gimley on Wednesday 17th of January 2018 02:06:13 AM
Old 01-17-2018
Thanks for your kind words. I am 70 years old. Accustomed to C programming and I guess in my hurry I forgot to check what is already available.

---------- Post updated 01-17-18 at 02:06 AM ---------- Previous update was 01-16-18 at 10:01 PM ----------

Dear Don,
Sorry to bother you.
I implemented the following awk script to handle the problem of concatenating two files where the first is the suffix file and the second is the root file
Code:
FNR==NR {S[$1];next} {printf "%s", $1; for (s in S) printf "/n%s%s", $1, s; printf "\n"}suffix root>root.out

The sample root file contains the following
Code:
walk
talk
seat
pick
laugh

The suffix file contains 3 suffixes in this order: The order is important.
Code:
s
ing
ed

However when the file is generated the order changes and a peculiar sort order is imposed. The output of the file is as under:
Code:
walk
walked
walks
walking
talk
talked
talks
talking

I have only pasted output of the first 2 verbs. As you can see the sort order is changed and is not the same. I have gone through the script and cannot detect which part what modifies the sort order. Is it because the files are in UTF8. I need this format to handle complex scripts like Devanagari or Arabic.
I desperately need the sort order in the suffix file to be retained.
If it is not too much trouble could you please comment the part of the script which modifies the sort order of the output.
Many thanks for your kind help
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Break a file into separate files

Hello I am facing a scenario where I have a file with XML content and I am running shell script over it. But the problem is the XML is getting updated with new services. In the below scenario, my script takes values from the xml file from one service name say ABCD. Since there are multiple, it is... (8 Replies)
Discussion started by: chiru_h
8 Replies

2. Shell Programming and Scripting

Concatenating Files In A Year/Month/Day File Structure

Hi Im trying to concatenate a specific file from each day in a year/month/day folder structure using Bash or equivalent. The file structure ends up like this: 2009/01/01/products 2009/01/02/products .... 2009/12/31/products The file I need is in products everyday and I need the script to... (3 Replies)
Discussion started by: Grizzly
3 Replies

3. Shell Programming and Scripting

Concatenating lines of separate files using awk or sed

For example: File 1: abc def ghi jkl mno pqr File 2: stu vwx yza bcd efg hij klm nop qrs I want the reult to be: abc def ghistu vwx yza jkl mno pqrbcd efg hij klm nop qrs (4 Replies)
Discussion started by: tamahomekarasu
4 Replies

4. UNIX for Dummies Questions & Answers

creating separate directories according to file extension and keeping file in different directory as

unix program to which a directory name will be passed as parameter. This directory will contain files with various extensions. This script will create directories with the names of the extention of the files and then put the files in the corresponding folder. All files which do not have any... (2 Replies)
Discussion started by: Deekay.p
2 Replies

5. UNIX for Dummies Questions & Answers

Creating a file where the owner and group is not root

Hi, I'm the root user on my computer, but I'm writing a script that does a lot of file handling. Every time I create a file or directory it automatically requires root privileges. Is there a way I can just create a file that the user can access without a password? For example in my script I... (20 Replies)
Discussion started by: jdilts
20 Replies

6. Shell Programming and Scripting

Concatenating 3 files into a single file

I have 3 files File1 C1 C2 c3 File 2 C1 c2 c3 File 3 C1 c2 c3 Now i want to have File1 as C1 c2 c3 I File2 as C1 c2 c3 O File3 as c1 c2 c3 D and these 3 files should be concatenated into a single file how can it be done in unix script? (3 Replies)
Discussion started by: Codesearcher
3 Replies

7. UNIX Desktop Questions & Answers

How can I replicate master master and master master MySQL databse replication and HA?

I have an application desigend in PHP and MySQl running on apache web server that I is running on a Amazon EC2 server Centos. I want to implement the master-master and master slave replication and high availability disaster recovery on this application database. For this I have created two... (0 Replies)
Discussion started by: Palak Sharma
0 Replies

8. Shell Programming and Scripting

Creating lemmatised forms by concatenating two files

Dear all, I am working on a noun, adjectiveand verb lemmatiser for Sindhi which will eventually be put up as open source for generic use. The tool will take a word and provide all possible forms of the word. To achieve this I have identified the root forms and the eventual suffixes which could... (3 Replies)
Discussion started by: gimley
3 Replies

9. Programming

creating separate output file for each input file in python

Experts, Need your help for this. Please support My motive is to create seperate output file for each Input Files(File 1 and File2) in another folder say(/tmp/finaloutput) Input files File 1(1.1.1.1.csv) a,b,c 43,17104773,3 45,17104234,4 File 2(2.2.2.2.csv) a,b,c 43,17104773,1... (2 Replies)
Discussion started by: as7951
2 Replies
IRISH(5)							File Formats Manual							  IRISH(5)

NAME
irish - flag format for Irish Ispell dictionaries DESCRIPTION
Irish dictionaries for Ispell(1) supports 3 prefix and 14 suffix flags. For a detailed description of how Ispell handles flags and capi- talization, see Ispell(4). This manual page only describes flags usable in dictionaries built using the gaeilge.aff affix file. The definitive meanings of the affixes is given in the file /usr/lib/ispell/gaeilge.aff but some of the reasoning and notes are given here. Irish has an unusual (unique?) capitalization rule, which needs special handling. Prefixes for eclipsis are not capitalized., e.g. an tEarrach. Ispell(5) assumes that in an uncapitalized word, the first letter may be capitalized, so Earrach would be incorrectly prefixed and capitalized as Tearrach. The file irish-prefixes.pl is a perl(1) script to preprocess the wordlist, and add 'by hand' the correct capitalization. It will turn Earrach/P into Earrach tEarrach etc. It strips off the E and P flags used for eclipsis and leaves any other flags intact. The word should be Capitalized in the the word list; if the uncapitalized version is left in the word list with the flag, it will generate incorrect words, so enter the uncapitalized and capitalized versions seperately. One 'ordinary' prefix is handled by Ispell, H is used for aspiration of nouns, etc. (Verbs are handled separately). Twelve suffixes are used for handling regular verbs. We use three suffixes each per conguation: one listing all suffixes available to both aspirated and unaspirated forms, one listing aspirated forms only, and one for unaspirated forms. So, for the verb mol for example, we have in the words list mol/BC mhol/BD so the 'B' set of endings apply to both forms, the 'C' set to unaspirated only, and 'D' to aspirated only. This pattern is repeated for all four conjugations. Irregular verbs just appear in the list in toto. Two other suffixes are currently defined, , 'O' for Caolu (attenuation), and 'Q'for Leathnu (broadening). BUGS
The dictionary is very small, and pretty incomplete. Any help would be appreciated. Please mail additions and corrections to mck- instry@computer.org SEE ALSO
Ispell(1), Ispell(5), english(5) 2002-04-11 IRISH(5)
All times are GMT -4. The time now is 10:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy