Sponsored Content
Top Forums Shell Programming and Scripting To Generate control chars[^M, ^C etc] Post 302535027 by saps19 on Wednesday 29th of June 2011 11:46:18 AM
Old 06-29-2011
To Generate control chars[^M, ^C etc]

Hi Experts,

Please let me know, how to generate control characters in a file.

I want to test my script which will check for any control characters in a file[.dat] before loading the data into the PRD Database.

Thanks in Advance,
Sapy.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

replace chars,

:rolleyes: Hi, I want to replace the particular text in the middle of the line. Ex. In the line 40-50 wanted to replace the char as 'x' (7 Replies)
Discussion started by: Jairaj
7 Replies

2. Shell Programming and Scripting

cut last 4 chars

hi i wanted to cut last 4 chars from a text file Input A-B-C-V-15-0115 A-BL-CLE-T-VALUE-0125 M-T-L-G-0115 AT-PR-PE-CCT-0135 Output 0115 0125 0115 0135 I tried cut -f - -d "-" (thinking cut -f 5- -d"-" gives 5 ot end of line so only - should give last but floped) (5 Replies)
Discussion started by: pbsrinivas
5 Replies

3. Shell Programming and Scripting

Generate Checksum control

I find a idea to generate a Chcksum code to put in a table the file/table are only string (char and number ) ex: file original: value description univocal 20 char/number univocal AABC01 AAAAABBBB8765367BBBAA ... (0 Replies)
Discussion started by: ZINGARO
0 Replies

4. Shell Programming and Scripting

How to convert C source from 8bit chars to 16bit chars?

I was using the following bash command inside the emacs compile command to search C++ source code: grep -inr --include='*.h' --include='*.cpp' '"' * | sed "/include/d" | sed "/_T/d" | sed '/^ *\/\//d' | sed '/extern/d' Emacs will then position me in the correct file and at the correct line... (0 Replies)
Discussion started by: siegfried
0 Replies

5. Shell Programming and Scripting

find 4 chars on 2nd line, 44 chars over

I know this should be simple, but I've been manning sed awk grep and find and am stupidly stumped :( I'm trying to use sed (or awk, find, etc) to find 4 characters on the second line of a file.txt 44-47 characters in. I can find lots of sed things for lines, but not characters. (4 Replies)
Discussion started by: unclecameron
4 Replies

6. UNIX for Dummies Questions & Answers

Find all chars before .

Howdy, I need a command which will find all of the characters in a line before the first . I am using Korn Thank you (3 Replies)
Discussion started by: jgrosecl
3 Replies

7. UNIX for Dummies Questions & Answers

number of chars

I am curious why the below returns 4 instead of 3 wc -c <<<aaa Whereasa=aaa;echo ${#a} returns 3. How to get 3 using here -string operator in the above scenario Thanks (2 Replies)
Discussion started by: pandeesh
2 Replies

8. Shell Programming and Scripting

Script to generate sheet with control-m table names

hi , i have control-m tool where i can schedule my unix script jobs to run automatically by created them in a table.. now i want a script to generate the sheet with table names that are created in cotrol-m tool... i dont know whether it possible or not.. thanks in advance. hemanth saikumar (6 Replies)
Discussion started by: hemanthsaikumar
6 Replies

9. Shell Programming and Scripting

Find Special/Null/Control Chars and Print Line Numbers

Hi All, This might be a basic question... I need to write a script to find all/any Speacial/Null/Control Chars and Print Line Numbers from an input file. Output something like Null Characters in File Name at : Line Numbers Line = Print the line Control Characters in File Name at : Line... (2 Replies)
Discussion started by: Kevin Tivoli
2 Replies

10. UNIX for Beginners Questions & Answers

Shell script to split data with a delimiter having chars and special chars

Hi Team, I have a file a1.txt with data as follows. dfjakjf...asdfkasj</EnableQuotedIDs><SQL><SelectStatement modified='1' type='string'><! The delimiter string: <SelectStatement modified='1' type='string'><! dlm="<SelectStatement modified='1' type='string'><! The above command is... (7 Replies)
Discussion started by: kmanivan82
7 Replies
control(n)						     Tcl Control Flow Commands							control(n)

NAME
control - Procedures for control flow structures. SYNOPSIS
package require Tcl 8.2 package require control ?0.1? control::control command option ?arg arg ...? control::assert expr ?arg arg ...? control::do body ?option test? control::no-op ?arg arg ...? DESCRIPTION
The control package provides a variety of commands that provide additional flow of control structures beyond the built-in ones provided by Tcl. These are commands that in many programming languages might be considered keywords, or a part of the language itself. In Tcl, con- trol flow structures are just commands like everything else. COMMANDS
control::control command option ?arg arg ...? The control command is used as a configuration command for customizing the other public commands of the control package. The com- mand argument names the command to be customized. The set of valid option and subsequent arguments are determined by the command being customized, and are documented with the command. control::assert expr ?arg arg ...? When disabled, the assert command behaves exactly like the no-op command. When enabled, the assert command evaluates expr as an expression (in the same way that expr evaluates its argument). If evaluation reveals that expr is not a valid boolean expression (according to [string is boolean -strict]), an error is raised. If expr evalu- ates to a true boolean value (as recognized by if), then assert returns an empty string. Otherwise, the remaining arguments to assert are used to construct a message string. If there are no arguments, the message string is "assertion failed: $expr". If there are arguments, they are joined by join to form the message string. The message string is then appended as an argument to a callback command, and the completed callback command is evaluated in the global namespace. The assert command can be customized by the control command in two ways: [control::control assert enabled ?boolean?] queries or sets whether control::assert is enabled. When called without a boolean argument, a boolean value is returned indicating whether the control::assert command is enabled. When called with a valid boolean value as the boolean argument, the control::assert command is enabled or disabled to match the argument, and an empty string is returned. [control::control assert callback ?command?] queries or sets the callback command that will be called by an enabled assert on assertion failure. When called without a command argument, the current callback command is returned. When called with a command argument, that argument becomes the new assertion failure callback command. Note that an assertion failure callback command is always defined, even when assert is disabled. The default callback command is [return -code error]. Note that control::assert has been written so that in combination with [namespace import], it is possible to use enabled assert com- mands in some namespaces and disabled assert commands in other namespaces at the same time. This capability is useful so that debugging efforts can be independently controlled module by module. % package require control % control::control assert enabled 1 % namespace eval one namespace import ::control::assert % control::control assert enabled 0 % namespace eval two namespace import ::control::assert % one::assert {1 == 0} assertion failed: 1 == 0 % two::assert {1 == 0} control::do body ?option test? The do command evaluates the script body repeatedly until the expression test becomes true or as long as (while) test is true, depending on the value of option being until or while. If option and test are omitted the body is evaluated exactly once. After nor- mal completion, do returns an empty string. Exceptional return codes (break, continue, error, etc.) during the evaluation of body are handled in the same way the while command handles them, except as noted in LIMITATIONS, below. control::no-op ?arg arg ...? The no-op command takes any number of arguments and does nothing. It returns an empty string. LIMITATIONS
Several of the commands provided by the control package accept arguments that are scripts to be evaluated. Due to fundamental limitations of Tcl's catch and return commands, it is not possible for these commands to properly evaluate the command [return -code $code] within one of those script arguments for any value of $code other than ok. In this way, the commands of the control package are limited as compared to Tcl's built-in control flow commands (such as if, while, etc.) and those control flow commands that can be provided by packages coded in C. An example of this difference: % package require control % proc a {} {while 1 {return -code error a}} % proc b {} {control::do {return -code error b} while 1} % catch a 1 % catch b 0 SEE ALSO
expr, if, join, namespace, return, string, while, break, continue KEYWORDS
control, flow, structure, no-op, assert, do control 0.1 control(n)
All times are GMT -4. The time now is 06:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy