Overview
Comment:Replace sub by gsub -- need to replace ALL ,
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: cefd35504224758d64a02126ea287b794791ec2887550860523af86cc067812d
User & Date: gawthrop@users.sourceforge.net on 1998-07-03 15:21:26
Other Links: branch diff | manifest | tags
Context
1998-07-03
17:38:32
Initial revision check-in: 15f94c34bf user: gawthrop@users.sourceforge.net tags: origin/master, trunk
15:21:26
Replace sub by gsub -- need to replace ALL , check-in: cefd355042 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
15:02:25
Work alias added check-in: e47a0a3a35 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/lbl2alias_txt2txt from [5df789175c] to [2b9de118c4].

10
11
12
13
14
15
16



17
18
19
20
21
22
23
# Copyright (c) P.J.Gawthrop 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.2  1998/07/03 07:54:39  peterg
## Tidied
##
## Revision 1.1  1998/07/02 09:22:10  peterg
## Initial revision
##
## Revision 1.2  1998/07/02 08:34:00  peterg







>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright (c) P.J.Gawthrop 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.3  1998/07/03 13:49:03  peterg
## Flips the order of alias and name when $ is involved.
##
## Revision 1.2  1998/07/03 07:54:39  peterg
## Tidied
##
## Revision 1.1  1998/07/02 09:22:10  peterg
## Initial revision
##
## Revision 1.2  1998/07/02 08:34:00  peterg
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
    awk '{
      if (match($2,"\\$")==0){
        alias=$2; name =$3
      }
      else{
        alias=$3; name =$2
      }
      sub(",","__",alias); #Replace ,
      n=split(alias,a,"|");
      for (i=1; i<=n; i++)
        print a[i] "\t" name;
	 }
      END{
      print "###_END_OF_ALIAS_###"
     }' >> $1_alias.txt







|







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
    awk '{
      if (match($2,"\\$")==0){
        alias=$2; name =$3
      }
      else{
        alias=$3; name =$2
      }
      gsub(",","__",alias); #Replace ,
      n=split(alias,a,"|");
      for (i=1; i<=n; i++)
        print a[i] "\t" name;
	 }
      END{
      print "###_END_OF_ALIAS_###"
     }' >> $1_alias.txt


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]