Sponsored Content
Top Forums Programming C++ separate code based on the few changes Post 302989158 by Don Cragun on Monday 9th of January 2017 09:20:37 AM
Old 01-09-2017
There are millions of ways to separate the code other than using the preprocessor.

What do you want to use other than whether or not SECOND_SIMULATOR has been #defined to make the decision of what code to use?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Separate based on file names

Hello experts, This might prove to be a stupid question to some of you, but I have tried to tackle it in different ways. Being new to shell scripting, I am requesting your help in coming up with an elegant solution. I am using Korn shell. We have a directory with file names with the pattern:... (2 Replies)
Discussion started by: prashk15
2 Replies

2. UNIX for Advanced & Expert Users

Process based code vs. Thread based code

I am just wondering on which is the best way to write programs on UNIX. Which one is better from below: a) Spawning threads per client connection/request? b) fork-exec new processes per client connection/request? Assume that I am doing some database system on linux which is supposed to run... (3 Replies)
Discussion started by: rkalyankumar
3 Replies

3. Shell Programming and Scripting

Using bash to separate files files based on parts of a filename

Hey guys, Sorry for the basic question but I have a lot of files that I want to separate into groups based on filenames which I can then cat together. Eg I have: (a_b_c.txt) WB34_2_SLA8.txt WB34_1_SLA8.txt WB34_1_DB10.txt WB34_2_DB10.txt WB34_1_SLA8.txt WB34_2_SLA8.txt 77_1_SLA8.txt... (1 Reply)
Discussion started by: Breentax
1 Replies

4. UNIX for Dummies Questions & Answers

using sed delete a line from csv file based on specific data in two separate fields

Hello, :wall: I have a 12 column csv file. I wish to delete the entire line if column 7 = hello and column 12 = goodbye. I have tried everything that I can find in all of my ref books. I know this does not work /^*,*,*,*,*,*,"hello",*,*,*,*,"goodbye"/d Any ideas? Thanks Please... (2 Replies)
Discussion started by: Chris Eagleson
2 Replies

5. Shell Programming and Scripting

[Solved] How to separate one line to mutiple line based on certain number of characters?

hi Gurus, I need separate a file which is one huge line to multiple lines based on certain number of charactors. for example: abcdefghi high abaddffdd I want to separate the line to multiple lines for every 4 charactors. the result should be abcd efgh i hi gh a badd ffdd Thanks in... (5 Replies)
Discussion started by: ken6503
5 Replies

6. Shell Programming and Scripting

Separate string based on delimiter

Hi, for fd in $(grep "/tmp/" hello.properties)The grep gives me the below output: deploydir=/tmp/app1/dfol prodir= /tmp/hello/prop ...... Now i want to store /tmp/app1/dfol then /tmp/hello/prop in a variable so that i can check if those folders files exists or not. The delimiter would... (4 Replies)
Discussion started by: mohtashims
4 Replies

7. Shell Programming and Scripting

How to separate a statement based on some delimiter and store each field in a variable?

Hi, Variable1 = MKT1,MKT2,MKT3,MKT4 Now i want to store each of these value seperated by comma to a array and access each of the values. Also find out number of such values seperated by comma. Variable1 can have any number of values seperated by comma. Thanks :) (3 Replies)
Discussion started by: arghadeep adity
3 Replies

8. Shell Programming and Scripting

How to separate based on delimiter?

Hi, Variable=MKT1,MKT2,MKT3 and so on i am trying to seperate MKT1,MKT2,MKT3 and store each in a variable. the values in variable1 may vary. I am using bash (8 Replies)
Discussion started by: arghadeep adity
8 Replies

9. Shell Programming and Scripting

Separate output based on dates

Hi guys! First time poster on here, was wondering if someone could help with a problem which I'm facing. Is it possible to use awk or sed to separate the below output based on TRANSACTION_DATE? The output would then feed into DataStage. Contents of CSV file:... (5 Replies)
Discussion started by: Jimmy_the_tulip
5 Replies

10. Shell Programming and Scripting

Improve awk code that has three separate parts

I have a very inefficient awk below that I need some help improving. Basically, there are three parts, that ideally, could be combined into one search and one output file. Thank you :). Part 1: Check if the user inputted string contains + or - in it and if it does the input is writting to a... (4 Replies)
Discussion started by: cmccabe
4 Replies
geniconvtbl(1)							   User Commands						    geniconvtbl(1)

NAME
geniconvtbl - generate iconv code conversion tables SYNOPSIS
geniconvtbl [-fnq] [-p preprocessor] [-W arg] [-Dname] [-Dname=def] [-Idirectory] [-Uname] [infile...] DESCRIPTION
The geniconvtbl utility accepts code conversion rules defined in flat text file(s) and writes code conversion binary table file(s) that can be used to support user-defined iconv code conversions (see iconv(1) and iconv(3C) for more detail on the iconv code conversion). OPTIONS
The following options are supported: -f Overwrites output file if the output file exists. -n Does not generate an output file. This is useful to check the contents of the input file. -p preprocessor Uses specified preprocessor instead of the default preprocessor, /usr/lib/cpp. -q Quiet option. It suppresses warning and error messages. -W arg Passes the argument arg to the preprocessor. If this option is specified more than once, all arguments are passed to the preprocessor. -Dname geniconvtbl recognizes these options and passes them and their arguments to the preprocessor. -Dname=def -Idirectory -Uname OPERANDS
The following operand is supported: infile A path name of an input file. If no input file is specified, geniconvtbl reads from the standard input stream. The user can specify more than one input file if necessary. OUTPUT
If input is from the standard input stream, geniconvtbl writes output to the standard output stream. If one or more input files are speci- fied, geniconvtbl reads from each input file and writes to a corresponding output file. Each of the output file names will be the same as the corresponding input file with .bt appended. The generated output files must be moved to the following directory prior to using the code conversions at iconv(1) and iconv(3C): /usr/lib/iconv/geniconvtbl/binarytables/ The output file name should start with one or more printable ASCII characters as the 'fromcode' name followed by a percentage character (%), followed by one or more printable ASCII characters as the 'tocode' name, followed by the suffix '.bt'. The 'fromcode' and 'tocode' names are used to identify the iconv code conversion at iconv(1) and iconv_open(3C)). The properly named output file should be placed in the directory, /usr/lib/iconv/geniconvtbl/binarytables/. EXAMPLES
Example 1: Generating an iconv code conversion binary table The following example generates a code conversion binary table with output file name convertA2B.bt: example% geniconvtbl convertA2B Example 2: Generating multiple iconv code conversion binary tables The following example generates two code conversion binary tables with output files test1.bt and test2.bt: example% geniconvtbl test1 test2 Example 3: Using another preprocessor The following example generates a code conversion binary table once the specified preprocessor has processed the input file: example% geniconvtbl -p /opt/SUNWspro/bin/cc -W -E convertB2A Example 4: Placing a binary table To use the binary table created in the first example above as the engine of the conversion 'fromcode' ABC to 'tocode' DEF, become super- user and then rename it and place it like this: example# mv convertA2B.bt /usr/lib/iconv/geniconvtbl/binarytables/ABC%DEF.bt Example 5: Providing modified ISO8859-1 to UTF-8 code conversion Write a geniconvtbl source file that defines the code conversion. For instance, you can copy over /usr/lib/iconv/genicon- vtbl/srcs/ISO8859-1_to_UTF-8.src into your directory and make necessary changes at the source file. Once the modifications are done, generate the binary table: example% geniconvtbl ISO8859-1_to_UTF-8.src As super-user, place the generated binary table with a unique name at the system directory where iconv_open(3C) can find the binary table: example su Password: example% cp ISO8859-1_to_UTF-8.bt /usr/lib/iconv/geniconvtbl/binarytables/my-iso-8859-1%utf-8.bt After that, you can do the iconv code conversion. For instance: example% iconv -f my-iso-8859-1 -t utf-8 testfile.txt ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of geniconvtbl: LANG and LC_CTYPE. EXIT STATUS
The following exit values are returned: 0 No errors occurred and the output files were successfully created. 1 Command line options are not correctly used or an unknown command line option was specified. 2 Invalid input or output file was specified. 3 Conversion rules in input files are not correctly defined. 4 Conversion rule limit of input files has been reached. See NOTES section of geniconvtbl(4). 5 No more system resource error. 6 Internal error. FILES
/usr/lib/iconv/geniconvtbl/binarytables/*.bt conversion binary tables /usr/lib/iconv/geniconvtbl/srcs/* conversion source files for user reference ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
cpp(1), iconv(1), iconv(3C), iconv_close(3C), iconv_open(3C), geniconvtbl(4), attributes(5), environ(5), iconv(5) Solaris Internationalization Guide for Developers NOTES
The generated and correctly placed output files, /usr/lib/iconv/geniconvtbl/binarytables/*.bt, are used in both 32-bit and 64-bit environ- ments. SunOS 5.10 30 Nov 2001 geniconvtbl(1)
All times are GMT -4. The time now is 03:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy