Sponsored Content
Top Forums Shell Programming and Scripting inserting a character between string Post 302210398 by ghostdog74 on Tuesday 1st of July 2008 12:25:10 AM
Old 07-01-2008
Code:
# sed 's/^\(.\{10\}\)/\1,/' file
0100159457,Italy Accounts
0100159458,Italy Accounts

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Inserting a character in a data file

Can some one tell me how I can insert a "|" (pipe) at the 15th column throughout a file? examples: to insert at begining of line i use :g/^/s//\|/ to insert at ene of line i use :g/$/s//\|/ how can i insert at the 15th column position. Thanks in advance (2 Replies)
Discussion started by: jxh461
2 Replies

2. Shell Programming and Scripting

inserting a String in the file(s)

Hi, I'm a newbee to Unix shell scripting. I want to write a shell script that inserts a new String(name&value pair) into a file(s) at a particular place.I willl have to write one script which when executed should insert a new variable in all the files in that particular directory. Say for eg:... (4 Replies)
Discussion started by: 2tbee
4 Replies

3. Shell Programming and Scripting

Inserting character in every line

help me, is there any script i can use to insert a single character in every line of the whole file? (1 Reply)
Discussion started by: dakid
1 Replies

4. Shell Programming and Scripting

Inserting newline in front of multi-character string

I'm working with a large file with multiple records, each record begins with ISA. The issue is, sometimes ISA is at the start of the line, sometimes it's in the middle of the line. So before I can csplit my main file into multiple records, I have to get each record header onto its own line. ... (7 Replies)
Discussion started by: verge
7 Replies

5. Shell Programming and Scripting

Inserting a string in another sting

Hi Experts, I need to insert a sting into another string at a specified position. Like the below. Regards, Tin-Tin (3 Replies)
Discussion started by: tinufarid
3 Replies

6. Shell Programming and Scripting

[Solved] SED - Bash - Inserting multi Tab character in the command

Hello. I am using : sed -i -e '/§name_script§/a#'"${MY_TAB11}"'# \ #'"${MY_TAB1}"'The Standard way'"${MY_TAB7}"'# \ #'"${MY_TAB1}"'==============='"${MY_TAB7}"'# \ ' "$CUR_FILE" Is there a better way to define "MY_TAB7","MY_TAB11" in other way than : MY_TAB1=$'\t' MY_TAB2=${MY_TAB1}$'\t'... (2 Replies)
Discussion started by: jcdole
2 Replies

7. Shell Programming and Scripting

Bash - Inserting non printable character(s) in string variable

Hello. I have a string variable named L_TEMP to test a very simple filter. L_TEMP="50AwL.|KWp9jk" I want to insert a non printable character between K and W. I have try this : linux-g65k:~ # a='50AwL.|K' linux-g65k:~ # b='Wp9jk' linux-g65k:~ # L_TEMP="$a$'\x07'$b" linux-g65k:~ # echo... (6 Replies)
Discussion started by: jcdole
6 Replies

8. Shell Programming and Scripting

Inserting a header with special character

Hi, I am trying to insert header row with a special character delimiter with Unicode u0109 into a file with ‘echo’, header looks like below echo –e “header1\u0109header\u0109header3\u0109header4” It just inserting as it is in the quotes but not the special character, Please suggest if am... (2 Replies)
Discussion started by: oom
2 Replies

9. Shell Programming and Scripting

sed searches a character string for a specified delimiter character, and returns a leading or traili

Hi, Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank. Text file : "1"|"ExternalClassDEA519CF5"|"Art1" "2"|"ExternalClass563EA516C"|"Art3" "3"|"ExternalClass305ED16B8"|"Art9" ... ... ... (2 Replies)
Discussion started by: fspalero
2 Replies

10. Shell Programming and Scripting

Inserting a non printable character in a file

For some testing I want to insert a non printable character in a file. How to do it? I inserted ctrl-v ctrl-k through vi. But I do not think it is a proper non printable character. (3 Replies)
Discussion started by: Soham
3 Replies
SET(7)								   SQL Commands 							    SET(7)

NAME
SET - change a run-time parameter SYNOPSIS
SET [ SESSION | LOCAL ] configuration_parameter { TO | = } { value | 'value' | DEFAULT } SET [ SESSION | LOCAL ] TIME ZONE { timezone | LOCAL | DEFAULT } DESCRIPTION
The SET command changes run-time configuration parameters. Many of the run-time parameters listed in in the documentation can be changed on-the-fly with SET. (But some require superuser privileges to change, and others cannot be changed after server or session start.) SET only affects the value used by the current session. If SET (or equivalently SET SESSION) is issued within a transaction that is later aborted, the effects of the SET command disappear when the transaction is rolled back. Once the surrounding transaction is committed, the effects will persist until the end of the session, unless overridden by another SET. The effects of SET LOCAL last only till the end of the current transaction, whether committed or not. A special case is SET followed by SET LOCAL within a single transaction: the SET LOCAL value will be seen until the end of the transaction, but afterwards (if the transaction is committed) the SET value will take effect. The effects of SET or SET LOCAL are also canceled by rolling back to a savepoint that is earlier than the command. If SET LOCAL is used within a function that has a SET option for the same variable (see CREATE FUNCTION [create_function(7)]), the effects of the SET LOCAL command disappear at function exit; that is, the value in effect when the function was called is restored anyway. This allows SET LOCAL to be used for dynamic or repeated changes of a parameter within a function, while still having the convenience of using the SET option to save and restore the caller's value. However, a regular SET command overrides any surrounding function's SET option; its effects will persist unless rolled back. Note: In PostgreSQL versions 8.0 through 8.2, the effects of a SET LOCAL would be canceled by releasing an earlier savepoint, or by successful exit from a PL/pgSQL exception block. This behavior has been changed because it was deemed unintuitive. PARAMETERS
SESSION Specifies that the command takes effect for the current session. (This is the default if neither SESSION nor LOCAL appears.) LOCAL Specifies that the command takes effect for only the current transaction. After COMMIT or ROLLBACK, the session-level setting takes effect again. Note that SET LOCAL will appear to have no effect if it is executed outside a BEGIN block, since the transaction will end immediately. configuration_parameter Name of a settable run-time parameter. Available parameters are documented in in the documentation and below. value New value of parameter. Values can be specified as string constants, identifiers, numbers, or comma-separated lists of these, as appropriate for the particular parameter. DEFAULT can be written to specify resetting the parameter to its default value (that is, whatever value it would have had if no SET had been executed in the current session). Besides the configuration parameters documented in in the documentation, there are a few that can only be adjusted using the SET command or that have a special syntax: SCHEMA SET SCHEMA 'value' is an alias for SET search_path TO value. Only one schema can be specified using this syntax. NAMES SET NAMES value is an alias for SET client_encoding TO value. SEED Sets the internal seed for the random number generator (the function random). Allowed values are floating-point numbers between -1 and 1, which are then multiplied by 231-1. The seed can also be set by invoking the function setseed: SELECT setseed(value); TIME ZONE SET TIME ZONE value is an alias for SET timezone TO value. The syntax SET TIME ZONE allows special syntax for the time zone specifi- cation. Here are examples of valid values: 'PST8PDT' The time zone for Berkeley, California. 'Europe/Rome' The time zone for Italy. -7 The time zone 7 hours west from UTC (equivalent to PDT). Positive values are east from UTC. INTERVAL '-08:00' HOUR TO MINUTE The time zone 8 hours west from UTC (equivalent to PST). LOCAL DEFAULT Set the time zone to your local time zone (that is, the server's default value of timezone; if this has not been explicitly set anywhere, it will be the zone that the server's operating system defaults to). See in the documentation for more information about time zones. NOTES
The function set_config provides equivalent functionality; see in the documentation. Also, it is possible to UPDATE the pg_settings system view to perform the equivalent of SET. EXAMPLES
Set the schema search path: SET search_path TO my_schema, public; Set the style of date to traditional POSTGRES with ``day before month'' input convention: SET datestyle TO postgres, dmy; Set the time zone for Berkeley, California: SET TIME ZONE 'PST8PDT'; Set the time zone for Italy: SET TIME ZONE 'Europe/Rome'; COMPATIBILITY
SET TIME ZONE extends syntax defined in the SQL standard. The standard allows only numeric time zone offsets while PostgreSQL allows more flexible time-zone specifications. All other SET features are PostgreSQL extensions. SEE ALSO
RESET [reset(7)], SHOW [show(7)] SQL - Language Statements 2010-05-14 SET(7)
All times are GMT -4. The time now is 06:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy